The plaintiff appeals from the judgment rendered in favor of the defendant in this action for the foreclosure of a mortgage. The plaintiffs principal claim of error is that the trial court erred in allowing testimony relating to a setoff against the underlying mortgage note even though a defense of setoff was not specially pleaded in the defendant’s answer. We find this claim to be unavailing and our conclusion thereon dispositive of the appeal. We find no error.
The facts relevant to this appeal are as follows. On November 1, 1978, the defendant, a real estate salesman and broker, became affiliated as an independent contractor with the plaintiff’s commercial real estate agency, Paul Elis & Company. Pursuant to the “independent contractor agreement” entered into by the defendant and the plaintiff’s agency, the defendant’s sole compensation was the receipt of commissions based upon his sales and leases. By October, 1982, the defendant had received extensive drawings against future commissions. The plaintiff then asked the defendant to secure his indebtedness before any further monies would be advanced. On October 21, 1982, the defendant signed a promissory note for $15,000 at 20 percent interest, payable in one installment upon maturity one year later. This note was secured by a first mortgage deed executed in California on property owned by the defendant in Orange, Connecticut. In December, 1982, the plaintiff sold his business, and the mortgage note *364and deed were assigned to Elis Central Investments, a personal investment account of the plaintiff and his former wife.
On February 22,1985, the plaintiff, claiming that the principal and interest due on the note had not been paid, brought a foreclosure action on the mortgage securing the note. In response to the plaintiffs demand for disclosure of defense, the defendant himself, not through his attorney,1 on April 16, 1986, filed the following disclosure of defense: “The Defendant, Maurice Rogers, has reason to believe and does believe that there exist bona fide defenses to the Plaintiffs action and these following defenses will be made by the Defendant: 1. The Defendant has satisfied the debt due to the Plaintiff; and 2. set off of mutual debts pursuant to Connecticut General Statutes Section 52-139.” (Emphasis added.) Although anticipated by such disclosure of defense, these defenses were not thereafter pleaded. The subsequent answer filed by the defendant consisted only of admissions and denials of the allegations in the plaintiffs complaint.
This matter was tried before the court on November 13,1986. The plaintiff testified that substantial payments, in the form of offsets against commissions owed the defendant, had been made against the mortgage *365note. The only issue before the court was the balance due and owing on the note. On the basis of the testimonial and documentary evidence before it, the court concluded that the note had been fully paid by the earned commissions credited against the defendant’s note, the method of payment chosen by the parties. Judgment was thereupon rendered for the defendant, and this appeal followed.
The controlling issue in this appeal is the plaintiff’s contention that the trial court erred in considering the defendant’s claimed setoff without its having been pleaded by the defendant. The plaintiff’s claim fails in several respects.
The plaintiff bases his argument on the fallacious premise that an issue of setoff was involved in this case. No setoff was pleaded or implicated here. “The law of setoff is governed by General Statutes § 52-139. The relevant portion of that statute provides: ‘(a) In any action brought for the recovery of a debt, if there are mutual debts between the plaintiff or plaintiffs, or any of them, and the defendant or defendants, or any of them, one debt may be set off against the other.’ (Emphasis added.) A condition precedent to the application of § 52-139 is that the defendant’s claim arise from a debt due by the plaintiff. See Savings Bank of New London v. Santaniello, 130 Conn. 206, 211, 33 A.2d 126 (1943). It is the defendant’s burden to demonstrate its right of setoff by affirmatively and adequately alleging such a claim in the pleadings. Practice Book § 168; Peters Production, Inc. v. Dawson, 182 Conn. 526, 528, 438 A.2d 747 (1980).” Petti v. Balance Rock Associates, 12 Conn. App. 353, 362, 530 A.2d 1083 (1987).
The defendant did not affirmatively allege the existence of any debt due and owing him from the plaintiff. As the trial court noted in its oral decision, the *366defendant was not making a specific claim for commissions owed; the defendant’s contention was rather that the commissions he was due “should have been applied to the note and this note has been fully paid.” The defendant’s defense of payment, and his claim as to the method of payment on the note, was not a defense of setoff.
A defense of payment, even though nonpayment is alleged by the plaintiff, must be specially pleaded. Practice Book § 164. To the extent that the defendant’s claim of payment was a defense, it properly should have been pleaded as such. Although the defendant did not specially plead this defense, however, evidence relating to the method of payment on the note was admitted without objection by the plaintiff. Not only did the plaintiff fail to object to the admission of such evidence, which included his own business records, but the trial record reveals that it was the plaintiff who initially introduced evidence that the method of payment of the mortgage note was by crediting earned commissions towards the defendant’s debt. Any defect in the pleading is therefore deemed to have been waived. Lake Williams Beach Assn. v. Gilman Bros. Co., 197 Conn. 134, 140-41, 496 A.2d 182 (1985); Damora v. Christ-Janer, 184 Conn. 109, 112, 441 A.2d 61 (1981).
After consideration of the testimony of both parties to this action, as well as a review of the documentary evidence submitted, the court found that the plaintiff had not proven his case. “ ‘ “Our review of the trial court’s factual findings is limited solely to the determination of whether they are supported by the evidence or whether, in light of the evidence and pleadings in the whole record, they are clearly erroneous. Practice Book § 4061. . . . The function of an appellate court is to review, and not retry, the proceedings of the trial court.” . . . Petti v. Balance Rock Associates, [ supra, 357].’ Licari v. Blackwelder, 14 Conn. App. 46, 51, 539 *367A.2d 609 (1988).” (Citations omitted.) Lembo v. Schlesinger, 15 Conn. App. 150, 153-54, 543 A.2d 780 (1988). We review the trial court’s factual findings to ensure that they could have been found “ ‘legally, logically and reasonably.’ . . . Licari v. Blackwelder, supra, 52.” (Citations omitted.) Lembo v. Schlesinger, supra, 154. Our review of the record discloses ample support for the court’s findings.
There is no error.
In this opinion the other judges concurred.
Practice Book § 236 provides that in any action to foreclose a mortgage, as well as in other specified cases, in which an attorney appears for the defendant, the plaintiff may at any time require such attorney to present to the court, to become a part of the file, “a writing signed by kirn stating whether he has reason to believe and does believe that there exists a bona fide defense to the plaintiffs action and whether such defense will be made, together with a general statement of the nature or substance of such defense.” (Emphasis added.) We note that the disclosure of defense filed in this case was not presented and signed by the attorney for the defendant and was, therefore, not in compliance with this procedural rule. The purpose of requiring that counsel certify to the existence of a “bona fide defense” to a foreclosure action, and to the other actions specified in the rule, where defenses are limited in number and scope, is self-evident.