
20 N.Y.2d 498 (1967)
Dittmar Explosives, Inc., Appellant,
v.
A. E. Ottaviano, Inc., et al., Respondents.
Court of Appeals of the State of New York.
Argued September 27, 1967.
Decided November 2, 1967.
Andrew Russell Willing and Edward B. Willing for appellant.
Norman Roth and John B. Gilleran for respondents.
Chief Judge FULD and Judges VAN VOORHIS, BURKE, SCILEPPI, BERGAN and KEATING concur.
*500BREITEL, J.
Plaintiff Dittmar Explosives, an unpaid materialman, appeals from dismissal, after a nonjury trial, of its action to foreclose a mechanic's lien against the general contractor and its surety. The Appellate Division affirmed the dismissal by a divided court. (Plaintiff was awarded judgment for $9,218.23 against its insolvent vendee, a subcontractor.) The ground for dismissal was that the lien had lapsed for failure to comply with section 18 of the Lien Law requiring that an action be brought and a notice of pendency be filed within the six months prescribed by the statute.
It is concluded that the lien had lapsed but that nevertheless plaintiff materialman had made timely application to the trial court to amend its complaint and to have the action treated as one to recover under the trust provisions of the Lien Law. Consequently, the order should be reversed and the action remanded to the Supreme Court to entertain the amendment of the complaint on such conditions as may be appropriate.
In 1957, defendant Ottaviano was the general contractor for the construction of a portion of a State highway. It subcontracted to Curly Construction Co., the insolvent vendee, the performance of certain work required for the project and Curly in turn purchased and received explosive materials aggregating $10,268.84 from plaintiff Dittmar Explosives for work on the project. Plaintiff was not paid.
On February 20, 1959 plaintiff filed a notice of mechanic's lien in the amount owed to it by Curly. The lien was thereafter discharged, pursuant to a bond in the amount of $12,000, filed and executed by the general contractor and the surety.
Over six months later, on September 3, 1959, the lien was extended for one year by order of Supreme Court, Westchester County. No notice of pendency was filed and the materialman instituted this action for foreclosure of its lien on May 13, 1960. Defendants raised no affirmative defenses in their answer although they denied generally the allegations with regard to the validity of the lien other than its filing and discharge.
The subcontractor, Curly, went into bankruptcy and, shortly before the trial of this action in 1963, the receiver for Curly paid *501 plaintiff $1,050.61 as its final bankruptcy distributive share (approximately 10% of its claim). Near the end of the trial, defendants for the first time raised the issue of whether the lien had lapsed and made a motion to dismiss the complaint on the ground that a notice of pendency had never been filed by the materialman.
In its posttrial briefs, in response to the newly raised contention of defendants, plaintiff urged that its action be considered as one brought under the trust fund provisions of the Lien Law (§ 25-a, now §§ 70-79). The trial court, however, dismissed the action on the ground that the lien had lapsed and commented that plaintiff's complaint could not be treated as one to enforce a trust under the Lien Law because it had not been brought on behalf "of all beneficiaries of the trust" and that the court, therefore, lacked the power to grant the relief sought.
The dissenting Justices in the Appellate Division agreed that the lien was invalid but urged that plaintiff "be permitted to assert a claim [which could be based on the same facts] on the theory of a trust fund". They pointed out that such a procedure was possible "under the liberal provisions of the CPLR" and that plaintiff was entitled to some form of relief in order to avoid the unjust enrichment of defendants.
Under section 18 of the Lien Law, a lien does not "continue" after six months have elapsed from the date of filing notice "unless an action is commenced to foreclose such lien within that time, and a notice of the pendency of such action is filed with the comptroller of the state or the financial officer of the public corporation with whom the notice of such lien was filed, or unless an order be made by a court of record, continuing such lien, and a new docket be made stating such fact." Section 21 (subd. 2, par. [a]) also provides that a lien "may be discharged" by lapse of time unless a notice of pendency is filed or an order continuing the lien is filed within six months. Plaintiff filed notice of its lien on February 20, 1959 but it neither began an action of foreclosure with the filing of a notice of pendency nor did it obtain an order continuing the lien within six months. True, 10 days later, on September 3, 1959, an order was entered continuing the lien but the lien had already lapsed (Lien Law, § 21, subd. 2; Matter of American Bridge Co. [Larsen Co.], 204 Misc. 131; *502 Blanc, Mechanics' Liens, par. 49a, esp. n. 16; cf. Triple Cities Constr. Co. v. Dan-Bar Contr. Co., 285 App. Div. 299, 306, affd. 309 N.Y. 665 [holding that there is no requirement for an order to cancel a lien which has already lapsed]).
Plaintiff urges that the purported lapsing of its lien, a point raised for the first time at trial, is an affirmative defense which must be pleaded. Two cases support this contention while another has taken a contrary view (compare National Lbr. Co. v. Braun & Son, 237 App. Div. 426, with Dwelle-Kaiser Co. v. Frid, 233 App. Div. 427, affd. 259 N.Y. 546, and Romeo v. City of Yonkers, 126 App. Div. 402, affd. 196 N.Y. 546).
The issue was decided, albeit sub silentio, by this court in Noce v. Kaufman (2 N Y 2d 347). In the Noce case, the plaintiff did not file a timely notice of pendency and, although the defense was not pleaded, this court affirmed the holding of the Appellate Division that the lien had lapsed. The plaintiff argued, relying on the Romeo and Dwelle-Kaiser decisions, that the defense was waived if not pleaded (2 N Y 2d, p. 348). The opinion in the Noce case made no reference to this point, but, significantly, cited the National Lumber case (supra) in holding that the lien had lapsed.
But the very fact that defendants in this case may raise this defense at trial, without having pleaded it affirmatively, lends considerable support to plaintiff's contention that it should have been allowed to amend its complaint. As the dissenting Justices in the Appellate Division observed, plaintiff might well be entitled to recover on the same facts, even after the lapsing of the lien, if the action had been brought in the proper form. And the CPLR provides that an action shall not fail solely because it is not brought in the proper form or under the precise pleading (CPLR 103, 3013, 3017, 3025).
Under CPLR 3025 (subd. [c]), the trial court could have permitted plaintiff to amend its complaint during or even after trial to allege a claim under the trust provisions of the Lien Law (see Davis & Warshow v. Iser, Inc., 30 Misc 2d 528, 540, where similar relief was granted before trial). CPLR states that leave to amend should be granted "freely" even if the amendment substantially alters the theory of recovery (CPLR 3025, subd. [b]; 3 Weinstein-Korn-Miller, N. Y. Civ. Prac., pars. *503 3013.05, 3025.26, 3025.28). If leave to amend were to be granted here, a continuance could be allowed to ascertain whether there are any other beneficiaries (and plaintiff asserts there are none) who should be joined as parties (cf. CPLR 3025, subd. [b]).
Defendants contend that plaintiff unduly delayed in making its motion but it appears that plaintiff sought to amend, or at least sought relief on a trust theory, as soon as possible after the defense was raised at the end of trial. Moreover, it has been held that when, as here, a motion to test the validity of a complaint is not made at an early stage in the litigation (when it could possibly be corrected) but instead is reserved until trial, "the court usually will permit amendment and allow the case to be heard and determined on its merits" (3 Weinstein-Korn-Miller, op. cit., par. 3025.27; see National Bank of Deposit v. Rogers, 166 N.Y. 380, 387-388; Feizi v. Second Russian Ins. Co., 199 App. Div. 775, 777-778).
Finally, defendants contend that a claim under the trust provisions would be barred because it would not have been brought within a year after the completion of the improvement (Lien Law, § 75, then in effect). Since there is dispute as to when the work was completed this, of course, only raises an issue of fact which can be resolved upon a new trial.
To be sure, the trial court has wide discretion to grant or withhold relief under CPLR 3025, but the Supreme Court in this case stated that it was without power to grant the relief sought. This raises a question of law reviewable in this court (Cohen and Karger, Powers of the New York Court of Appeals [Rev. ed.], § 156, pp. 607-609). Consequently, this court should indicate the existence of the power and remand the case for a proper exercise of discretion. The Supreme Court could well consider defendants' delay in raising the defense, the relative ease with which the complaint could have been amended, and the facts supporting plaintiff's right to recover under an available alternative theory.
Accordingly, the order of the Appellate Division should be reversed, with costs to plaintiff-appellant against defendants-respondents, and the action remanded to Supreme Court, Westchester County, for appropriate proceedings in accordance with the views expressed in this opinion.
Order reversed, with costs, and matter remitted to the Supreme Court, Westchester County, for further proceedings in accordance with the opinion herein.
