
19 Ill. App.3d 565 (1974)
312 N.E.2d 11
CHICAGO TITLE AND TRUST COMPANY, as Trustee, Plaintiff-Appellee,
v.
EXCHANGE NATIONAL BANK OF CHICAGO, as Trustee, Defendant-Appellant  (STEPHEN T. GOODE et al., Intervening Petitioners-Appellants.)
No. 72-343.
Illinois Appellate Court  Second District.
May 29, 1974.
*566 Charles F. Marino, of Chicago, for appellant.
Albert Koretzky, of Chicago, for appellee.
Reversed and remanded.
Mr. JUSTICE SEIDENFELD delivered the opinion of the court:
The plaintiff, Chicago Title and Trust Company, as trustee, filed suit to foreclose a part-purchase-money junior trust deed against the defendant, Exchange National Bank of Chicago, as trustee of a land trust, the corpus of which was subject to the junior trust deed. A default order was entered. Defendant moved to vacate the order, and Stephen T. Goode and Rita C. Goode, sole beneficiaries of the land trust, petitioned to intervene. Both the motion to vacate and the intervention petition were denied and the court entered a foreclosure decree, from which the defendant and the Goodes appeal.
The foreclosure complaint was filed on August 12, 1971. Defendant's attorney entered his appearance on September 23, 1971, and on December 10, 1971, the court required defendant to answer within 28 days. On March 9, 1972, plaintiff presented a motion for default. A lawyer who shared office space with defendant's attorney appeared and requested a continuance. The accompanying affidavit alleged that defendant's attorney was out of town and unable to appear until March 23, 1972, and that plaintiff's attorney had been advised of these facts. The court, nevertheless, ordered that a default be entered and directed that the plaintiff prepare and submit a decree of foreclosure to the court on March 23, 1972, and that a copy be served upon defendant's attorney.
On March 21, 1972, defendant presented its motion to vacate alleging that it had a meritorious defense to the complaint for the following reasons: (1) The Goodes, as beneficiaries of the defendant trust, had tendered the August 1, 1971, payment due under the note to Riis-Borg, Inc., the alleged holder of the note, by a check in the amount of $3,009.75, which was the balance owing Riis-Borg after deducting a credit in the sum of $1,190.75 for reimbursement of monies expended to remedy a condition causing water to leak into the basement of the mortgaged premises in breach of the agreement between Riis-Borg and the Goodes; (2) the plaintiff failed to join Riis-Borg, Inc., the legal noteholder, as a party plaintiff; (3) the plaintiff failed to join the Goodes, the land trust beneficiaries in possession of the land, as party defendants; and (4) the transaction of business in Illinois by Riis-Borg, Inc. (as opposed to Riis Borg, Inc.), without having been incorporated or licensed in Illinois, barred collection on the note.
*567 On the same March 21st date, the Goodes filed a petition to intervene alleging the same defenses. In denying both the motion to vacate and the petition, the court ruled that the defendant had not shown a meritorious defense. The court also denied defendant's petition to require Riis Borg, Inc., to accept $8,400 instead of the entire accelerated amount due.
The initial question is whether a mortgagor can credit on installments due amounts owing from the mortgagee-seller arising from breach of a covenant in the real estate contract giving rise to the purchase-money notes, without incurring a default and acceleration of the entire mortgage indebtedness. The plaintiff contended, and the trial court found, that the Goodes were relegated to their legal remedies to file a contract action to recover for the alleged breach and could not set off the amount claimed to be due from the mortgage payment. We do not agree.
 1 There is no default which would permit the mortgagor to accelerate the maturity of the debt when there is a setoff available which is equal to or exceeds the amount of the indebtedness due at the time of default. (Mason v. Griffith (1917), 281 Ill. 246, 256; Smith v. Niemann (1919), 216 Ill. App. 179, 186; see also Hauger v. Gates (1954), 42 Cal.2d 752, 269 P.2d 609, 610-611.) The rule is based on the reasoning that it would be inequitable to permit one by his own act to cause a partial failure of the consideration for the mortgage without requiring him to credit the amount of such failure upon the indebtedness for the purchase price of the property. Brinton v. Johnson (1922), 35 Idaho 656, 208 P. 1028, 1031; see also State Bank v. Burr (1939), 372 Ill. 114, 117-118; Dunlap v. Peirce (1929), 336 Ill. 78, 184; Northern Trust Co. v. Sanford (1923), 308 Ill. 381, 387; Schmisseur v. Penn (1893), 47 Ill. App. 278, 285.
Here it appears from the allegations in the pleadings that on June 30, 1970, Riis-Borg, Inc., and Stephen T. Goode entered into a real estate contract for 41.5 acres of land and a residence thereon in McHenry County. By the terms of the contract, Stephen Goode agreed to purchase the property for $115,000. Riis-Borg, Inc. received all but $15,000 of the purchase price by the time of closing. The $15,000 balance was to be paid in five annual installments with interest to be secured by a second mortgage in that amount. The seller agreed, inter alia, to "remedy condition which permits water to leak into basement." It also appeared that the seller owned the land in a land trust with the Exchange National Bank of Chicago under its Trust #22399. The contract provided that the seller could convey to Stephen Goode's nominee.
At closing, Goode and his wife took title as beneficiaries of Land Trust #24079, in which the Exchange National Bank was retained as trustee. The junior trust deed and installment note expressly provided that it was *568 payable only out of the property specifically described in the trust deed, and that no personal liability could be asserted against the trustee of the land trust or any beneficiaries. The first installment with interest was to be paid on August 1, 1971, about 1 year after closing.
Because of the leaky basement, difficulties ensued after closing but before the first installment became due. Although Riis-Borg, Inc., confirmed its agreement to remedy the defect and made some effort to do so, the basement continued to flood. After attempting to have Riis-Borg make the repairs the Goodes hired an outside plumber who made the repairs for which they paid $1,190.25, which they then credited or setoff on the first installment.
These allegations, assumed to be true for the purpose of determining whether a meritorious defense was stated, were sufficient to allege the defense. The purchaser was entitled to credit the cost of plumbing repairs after efforts were made to secure the seller's compliance with its obligations under the real estate contract. A tendering of the balance of the installment and interest prevented the default and the acceleration of the entire mortgage indebtedness.
Plaintiff's suggestion that defendant should have filed a counterclaim for setoff instead of a defense is without merit. The defense, if valid, shows the defendant is not in default and prevents acceleration of the entire mortgage indebtedness. Similarly, plaintiff's contention that it is deprived of a jury trial on the contract action is without merit since the contract determination is necessarily incidental to the determination of the right to foreclose.
The judgment of foreclosure must therefore be reversed and the cause remanded with directions to the trial court to vacate the decree of foreclosure and to permit the defendant to proceed with its defense.
We will rule, however, on the other issues raised by the defendant since they may remain material in the event defendant is unable to prove that it was entitled to the credits claimed at the time of the alleged default.
We do not agree with defendant's purported defense that the legal noteholder under a trust deed is a necessary party to a foreclosure action. While the general rule is that all persons interested in the subject matter of a suit should be made parties thereto, there is an exception in the case of the foreclosure of a mortgage or trust deed when the noteholder is properly represented by the trustee who is made a party. White v. Macqueen (1935), 360 Ill. 236, 243.
The defendant also claims that the failure of the plaintiff to join the Goodes as the land trust beneficiaries in possession of the property which *569 is the subject of the foreclosure suit, provides a further defense to the foreclosure. Under prior law, ordinarily a beneficiary of an Illinois land trust was not a necessary party to a foreclosure. Marshall v. Solomon (1948), 335 Ill. App. 302, 309.[1]
Both parties in this appeal acknowledge that the Illinois Mortgage and Foreclosure Act enacted in 1961 excludes "a beneficiary of a trust in actual possession of the land or some part thereof" from its definition of "non-record claimant." (Ill. Rev. Stat. 1971, ch. 95, par. 23.1.) Since the Act is designed to dispense with joining certain non-record claimants in foreclosure suits, an implication could possibly be drawn that land trust beneficiaries in possession are entitled to be joined as parties. We think a more persuasive argument, however, is that advanced by the plaintiff who contends that the Act neither confers nor denies joinder to land trust beneficiaries in possession. This position is supported by section 4 of the Act (Ill. Rev. Stat. 1971, ch. 95, par. 23.3), which requires resort to prior law to determine the necessity of joinder of persons other than non-record claimants.
As we have noted, under prior law, ordinarily the beneficiary of the land trust would not be a necessary party. We must then determine whether the fact that the beneficiary is also in possession alters this rule. Ordinarily a tenant in possession is a necessary party to a foreclosure action. (Richardson v. Hadsall (1883), 106 Ill. 476, 479-480; South Side Bank & Trust Co. v. Sherlock Homes, Inc. (1955), 6 Ill. App.2d 138, 143; Chicago Title & Trust Co. v. Herlin (1939), 299 Ill. App. 429, 440-441.) Where, however, no possessory rights of the tenant are determined or disturbed by a decree of foreclosure the failure to make the tenant a party will not vitiate the action. See Bleck v. Cosgrove (1961), 32 Ill. App.2d 267, 274; Chicago Title & Trust Co. v. Herlin (1939), 299 Ill. App. 429, 440.
 2 A land trust beneficiary who occupies the land is not in the same position as an ordinary tenant. The tenant who is not made a party is in no way affected by the decree and can remain in possession; whereas, the beneficiary of the land trust who is in possession is bound by the acts of his trustee. We conclude, therefore, that the land trust beneficiary in possession is subject to the same rationale which we have expressed in regard to the legal noteholder under the trust deed. The land trust beneficiary in possession need not be joined as a necessary party to the foreclosure if the trustee can fully protect the beneficiary's interests. When, *570 however, it appears that the trustee may not be able to protect the beneficiary's interests, the latter should have the option of intervening in the foreclosure proceeding. See Ill. Rev. Stat. 1971, ch. 110, par. 26.1.
Here the beneficiaries of the land trust are claiming a setoff or credit for a claim arising out of the sale and mortgage transaction and seek to introduce that claim into the foreclosure proceedings. The plaintiff takes the position that the defendant as a land trustee cannot defend on the ground of failure of consideration or claim the off-setting credit because it was not a party to the real estate contract; and that the land trust beneficiaries cannot intervene to raise the same defense because they are not parties to the trust deed or to the note secured by it. By defendant's view nobody would have standing to raise a valid defense to the foreclosure.
 3 In the circumstances of this case, the trustee is an appropriate party to raise the defense of failure of consideration by Riis-Borg, Inc., and to claim the off-setting credit in order to prevent default. The trustee signed the note in consideration for the realty, and in addition represents the beneficiaries who would be bound by any decree affecting the land and which would conclude their rights in it. Since the trustee can raise the defense, there is no need for the beneficiaries to intervene. Thus the denial of their intervention petition was not error. See White v. Macqueen, 360 Ill. 236, 243; Breed v. Baird (1907), 139 Ill. App. 15, 25-26.
In the event that the defense is not proved and the default is then confirmed by the court, we conclude that the acceleration of the entire balance on the note was properly ordered and relief from the acceleration of the balance due properly denied. Neither the trustee nor the beneficiaries of the land trust are in a position to show timely compliance with section 7 of the Mortgages Act. Ill. Rev. Stat. 1971, ch. 95, par. 57; see Paulauskas v. Rumsas (1971), 1 Ill. App.3d 460, 464; see also Curran v. Houston (1903), 201 Ill. 442, 445.
We, therefore, reverse the judgment below and remand the cause with directions to hear proofs relating to the claimed off-setting credit and to therefore reach a determination as to whether the mortgage is, in fact, in default, in accordance with the views expressed in this opinion.
In this view we do not reach the question of the propriety of the attorneys' fees which were allowed.
Reversed and remanded with directions.
GUILD and RECHENMACHER, JJ., concur.
NOTES
[1]  It is not certain from the opinion that the beneficiaries were in possession of the subdivision involved, although there is a reference to the fact that "tenants or parties in possession" (page 304) were made parties as unknown owners.
