delivered the opinion of the court:
Plaintiff, Grossman Clothing Co., Inc., appeals an order of the trial court granting judgment to defendants, Myles and Susan Gordon, partners doing business as Bradford Clothes. On appeal, plaintiff contends that (1) the trial court abused its discretion in refusing to allow plaintiff to file a reply to defendants’ answer, and (2) defendants’ answer did not establish a defense to plaintiff’s cause of action as a matter of law.
We reverse and remand for a new trial.
On June 27, 1979, plaintiff, a New York corporation engaged in the business of merchandising clothes, filed a complaint alleging that it had sold and delivered to defendants certain merchandise costing $10,282.07. Defendants did not pay for the goods. In their answer, filed October 26, 1979, defendants alleged that the merchandise was delivered in a damaged condition and was unmerchantable and unfit for the purposes intended. Defendants further alleged that they had notified plaintiff of the unfitness and unmerchantability and that they had tendered a return of the goods but the tender was refused.
On September 16, 1981, the trial began. Irvin Grossman, secretary of Grossman Clothing Co., testified. Copies of invoices for the goods shipped to defendants were admitted into evidence. Grossman stated that no portion of the amount owing had been paid. Plaintiff rested and defendants moved for a judgment on the pleadings and rested their case. The trial court found that defendants’ answer set forth an affirmative defense to which plaintiff had not replied. Plaintiff requested leave to file a reply instanter which was denied. The trial court gave judgment for defendants. Plaintiff appeals.
Plaintiff contends the trial court abused its discretion in refusing to allow plaintiff to file a reply to defendants’ answer. We agree. Section 32 of the Civil Practice Act (Ill. Rev. Stat. 1979, ch. 110, par. 32) provides that “[i]f new matter by way of defense is pleaded in the answer, a reply shall be filed by the plaintiff ***.” Section 59 of the Act (Ill. Rev. Stat. 1979, ch. 110, par. 59) provides that “[o]n good cause shown, in the discretion of the court and on just terms, additional time may be granted for the doing of any act or the taking of any step or proceeding prior to judgment.” The Civil Practice Act itself is to be “liberally construed, to the end that controversies may be speedily and finally determined according to the substantive rights of the parties.” Ill. Rev. Stat. 1979, ch. 110, par. 4.
We believe the circumstances of this case satisfy the “good cause” required by section 59. The complaint was filed on June 27, 1979, and the parties engaged in discovery prior to the start of trial. Defendants’ motion for judgment on the pleadings came at trial, at the close of plaintiff’s case and without prior notice. Normally, a motion for judgment on the pleadings is presented prior to discovery because it tests the sufficiency of the pleadings themselves. (Krych v. Birnbaum (1978), 66 Ill. App. 3d 469, 471, 384 N.E.2d 52, 54.) When the trial court ruled that defendants’ answer was an affirmative defense, plaintiff asked leave to file a reply instanter which the court denied.
A case on point is Krych v. Birnbaum (1978), 66 Ill. App. 3d 469, 384 N.E.2d 52, in which the appellate court held that the trial court erred in not allowing plaintiff to file a reply. In Krych, plaintiff had filed suit in January 1975. Defendant’s answers including allegations labeled affirmative defenses were filed in June 1975. Plaintiff never replied. Discovery was taken between June 1975 and October 1976. When defendant moved for judgment on the pleadings on the day set for trial without prior notice, plaintiff asked leave to reply instanter, but the trial court denied leave. The appellate court reversed, holding that the ends of justice required that leave be granted. Krych v. Birnbaum (1978), 66 Ill. App. 3d 469, 471.
Similarly, in the instant case, we believe the ends of justice require that plaintiff be granted leave to file a reply to defendants’ affirmative defense.
In view of this holding, we need not reach the second issue raised by plaintiff that defendants’ answer did not establish a defense as a matter of law.
For the foregoing reasons, the judgment of the circuit court of Cook County is reversed and the cause is remanded for a new trial.
Reversed and remanded.
JIGANTI and ROMITI, JJ., concur.