
    (119 App. Div. 376)
    MANEELY v. CITY OF NEW YORK et al.
    (Supreme Court, Appellate Division, First Department.
    May 17, 1907.)
    1. Mechanics’ Liens—Municipal Buildings—Funds—Distribution—Personal Judgment.
    Where a contractor for the heating and electric work of a city prison defaulted and his sureties thereupon contracted with another who, also defaulted, and IC, the latter’s surety, performed tiie work, but claimed no lien, he was not entitled to a personal judgment against the original contractor’s sureties in a suit in equity to enforce mechanics’ liens on the fund in the hands of the city available for payment of the work, unless tiie original contractor's sureties waived their right to a jury trial and submitted their liability to K. to the decision of the court.
    2. Same.
    Where, in a suit to foreclose alleged liens on the fund available for a municipal improvement, a subsequent contractor’s surety who completed tiie work demanded no personal judgment against the original contractor's sureties by whom his principal was employed, but only prayed that tiie complaint be dismissed and that lie have such other relief as might he warranted by the proof at the trial, he having no lien was not entitled to any part of the fund, which, barring statutory rights of lienors, was payable to the original contractors or their sureties.
    3. Jury—Waiver op Right to Trial by Jury.
    Where, in a suit to foreclose contractor’s liens on a fund available for the payment of work under a city contract, K., who completed tiie contract as surety for a subsequent contractor employed by the original contractor’s sureties, was joined as a party, the trial of an issue tendered by plaintiffs as between such original contractor’s sureties and K., concerning the performance of the contract by K. and plaintiffs for the purpose of defeating plaintiff’s liens, did not constitute an implied consent on the part of such original contractor’s sureties to submit to' the court the question of their liability to K.
    4. Mechanics’ Liens—Statutes—Construction.
    Code Civ. Proc. § ¡3403, providing that in a suit to foreclose mechanics’ liens the court may adjust and determine the equities of all the parties to the action, confers no authority on the court to award judgment on legal claims of a subsequent contractor’s surety 'against the sureties of the original contractor.
    5. Same—Performance by Sureties.
    In a suit to foreclose certain mechanics’ liens, evidence held to show that a subsequent contractor’s surety performed the work in his capacity as surety, and not under a new contract between himself and the sureties of the original contractor.
    6. Same—Performance by Surety—Rights of Lienors.
    While a contractor’s surety is under no legal obligation to the lienors to complete the work, yet, if he elects to do so as surety to protect himself against liability, it is deemed a completion by the principal, and the rights of the lienors attach to the fund on the theory that it has been earned under the contract in performance of which they furnished labor or material.
    7. Same—Rights op Surety.
    Where a contractor’s surety completes tiie contract as surety on default of the principal,, the surety can only receive the balance due after satisfying all lien claims.
    8. Same*—Original Contract—Cancellation.
    Where a subsequent contractor’s surety elected to complete the contract as surety, his relationship was not altered from that of surety to that of contractor by the cancellation of his principal's contract under a provision authorizing cancellation, for failure to proceed with due diligence.
    
      9. Same—Pasties.
    Where a lienor performed work and furnished material for a subcontractor, it was'not entitled to foreclose its mechanic’s lien in a suit to which such subcontractor was not a party, the judgment being conclusive against the original contractor’s sureties, who were .completing the work, as to the validity of the lienor’s claim of lien and the amount thereof.
    10. Same.
    Though the statute providing for foreclosure of mechanics’ liens does not require that the contractor be joined as a defendant, he is nevertheless a proper party.
    11. Same—Complaint—Statement of Lien.
    Where a complaint to foreclose a mechanic’s lien alleged that certain defendants had or claimed to have some interest or property in or lion on the moneys in the possession of the city applicable to the construction of the public improvement in question, but did not otherwise set forth nor admit the claim of one of such defendants, such claim could not be deemed uncontested by the other defendants, and hence it was bound to plead its lien in its answer, or it would be deemed waived as expressly provided by Code Civ. Proc. § 3402.
    12. Same—Rights of Lienor.
    One who furnishes labor and materials for a subcontractor is not entitled to a lien unless there is money due such subcontractor.
    13. Same—Action to Foreclose—Parties.
    AVhere an original contractor’s sureties had taken up the performance Of the work for the completion of a contract for the city of New York, and as contractors had bonded the lien, they thereby became the real parties in interest as to the rights of lienors having furnished labor and materials for subcontractors, so that they, and not the city, were proper parties to proceedings for the foreclosure of the liens of such lienors.
    14. Same.
    Under the express provisions of Code Civ. Proc. § 3402, all lienors, whether prior or subsequent, are necessary parties to a suit in a court of record to enforce mechanics’ liens, and this is so notwithstanding a bond has been substituted for the fund, and the lienors had not begun proceedings to foreclose their liens within the time fixed by statute, as extended by the court.
    Appeal from Supreme Court, Special Term.
    Action by Francis J. Maneely, administrator of the estate of John Maneely, deceased, against the city of New York and others, to enforce certain mechanics’ liens. From a judgment entered pursuant to a decision of the court on the trial of the issues at Special Term, plaintiff and defendant Catherine Daniels prosecute separate appeals, and defendants United States Fidelity & Guaranty' Company, Charles Francis Wood, and the American Bonding Company appeal from parts, of the judgment.
    Reversed, and new trial granted.
    Argued before PATTERSON, P. J., and INGRAHAM, LAUGH-LIN, CLARKE, and SCOTT, JJ.
    Leonidas Dennie, for appellants United States Fidelity & Guaranty Co. and Chas. Francis Wood.
    Perry D. Trafford, for appellant American Bonding Co.
    John F. McCann, Jr., for appellant Francis J. Maneely.
    Horace A- Davis, for appellant Catherine Daniels.
    Dean Emery, for respondent Tremain, as trustee in bankruptcy of Frank M. Pierce Engineering Co.
    Charles J. Hardy, for respondent ICieley.
   LAUGHLIN, J.

This is an action to foreclose a mechanic’s lien, filed against moneys due or to grow due the defendants, the surety companies, which, for brevity, will be designated the Fidelity and Bonding Companies, respectively, on a contract between the Armstrong & Boulton Company and the city of New York, bearing date the 20th day of April, 1899, for the construction of the high aiid low pressure steam plant dynamo and electric lighting plant and kitchen in the new city prison at Cedar, Franklin, and Leonard streets, for the gross sum of $93,325. The Armstrong Sc Boulton Company abandoned the work, and the Fidelity and Bonding Companies performed it as sureties.

The Armstrong Sc Boulton Company, the original contractors, abandoned the contract in March, 1900. The Fidelity and Bonding Companies were duly notified of the default of their principal and called upon to perform. They thereupon took charge of the work and through the defendant Wood, who was their only authorized agent, and in his name, made a subcontract with the Barron Sc Cooke Heating & Power Company, which will be referred to as the Barron & Cooke Company, on the 24th day of April, 1901, for completing the steamfitting for the high and low pressure steam plant, according to the plans and specifications, for $8,548; and the defendant Kieley became surety for the contractor to the extent of .$5,000, The Barron & Cooke Company commenced the work, and after receiving $4,093 thereon, which equaled or exceeded the amount then due and payable according to the terms of the contract, defaulted. Wood thereupon gave notice to the Barron & Cooke Company, pursuant to the contract, that, unless it prosecuted the work diligently and to his satisfaction, within eight days, he. would annul the contract, and he also gave Kieley as surety notice and called upon him to perform.' After the expiration of eight days Wood, assuming to act under the terms of the contract, annulled it. Kieley then had an interview with Wood, and it was agreed that he should complete the contract and should receive therefor the sum of $4,454.40, being the balance of the contract price unpaid to his principal,' the same as the principal would have received ,if it- had performed. He performed the work, but filed no lien; and he has recovered against the Fidelity and Bonding Companies the sum of $5,554.28, being the balance unpaid on the contract, and interest thereon from the date of completion, March 31, 1903, together'with costs and an extra allowance of $222. The trial court found that'Kieley, the surety for the Barron & Cooke Company, completed under a new and independent contract, and on that is the theory on which the entire balance of the fund was awarded to him. Plaintiff’s intestate and defendant Daniels furnished material and performed labor for the Barron & Cooke Company, for which they filed liens, and their appeal presents their contention that it should have been held that Kieley completed as assignee of or as surety for his principal and under its contract, and that their liens attached to the moneys thus earned in preference to any claim on his part.' The Fidelity and Bonding Companies also appeal from the judgment in favor of Kieley, and claim that his recovery against. them was unauthorized in this action, because he filed no lien, and they also claim that his answer is insufficient; but they do not admit that they are liable for the claims embraced in the liens of the plaintiff and Daniels.

Wood, representing the Fidelity and Bonding Companies, also contracted with the Eddy Electric Manufacturing Company, which we will designate as the Eddy Company, for the electric work, including the furnishing of electrical appliances, embraced in the original contract, and agreed to pay therefor the sum of $10,000. The Frank M. Pierce Engineering Company hereinafter designated the Pierce Company, performed part of the work and furnished some of the material for the Eddy Company for which it was not paid, and it filed a lien therefor. This action was not commenced until the 4th day of April, 1903. On the 18th day of November, 1902, more than four months prior to the commencement of the action, that lien was discharged by an order of the court made on the application of the Fidelity and Bonding Companies, on their own undertaking with the City Trust, Safe Deposit & Surety Company of Philadelphia as surety. The undertaking was in the form required by the statute and conditioned for the payment of “any judgment which may be recovered in an action to enforce such lien.” Pending the action, the Pierce Company was adjudicated a bankrupt, and its trustee in bankruptcy was thereafter substituted for it as a party defendant. He has recovered a judgment establishing the validity of the lien of the Pierce Company and its amount at $1,756.33; and for the foreclosure therof in form only, however, against the city, but adjudging that the Fidelity and Bonding Companies and Wood are indebted to him as such trustee in that amount for labor and material furnished under the Eddy Company contract, and that an amount in excess of said amount was due to the Fidelity and Bonding Companies from the city, and granting leave to said trustee to proceed against the undertaking given on the discharge of the lien, and in terms granting judgment in his favor against said undertaking and expr'essly reciting that the Fidelity and Bonding Companies, defendants herein, are the principals therein. The Fidelity and Bonding Companies also seek a reversal on the law, being content with the facts as found, of the judgment recovered by the trustee in bankruptcy. The claim and lien of the Pierce Company now held by the trustee in bankruptcy and the judgment recovered will, for the sake of brevity, be referred to as those of the Pierce Company. Neither the Eddy Company, under whose contract the plaintiff makes no claim, nor its subcontractor nor lienors, against the fund, of whom there were several, other than the Pierce Company, was made a party, or has come in, or has been brought in as a party; nor has the surety of the Fidelity and Bonding Companies on the undertaking given to discharge the lien been made a party. The more important propositions presented on the appeal will be stated and discussed separately.

First. The personal judgment in favor .of Kieley cannot be sustained. Unless the Fidelity and Bonding Companies and Wood, appellants, have waived their right to object to a recovery by Kieley of a personal judgment against them herein, it would seem under well-settled principles that his failure to file a lien is fatal to the judgment in his favor. If he had in good faith filed a lien, he might have recovered a personal judgment, even though the lien were declared invalid; but, having filed no lien, he had no standing to institute a suit in equity in his own behalf, and, if he could not have brought the action, he cannot, as a defendant, recover affirmative relief on a purely legal claim, unless the appellants have clearly waived their right to a jury trial and have submitted their liability to the decision •of the court herein. Deane Steam Pump Co. v. Clark, 84 App. Div. 450, 82 N. Y. Supp. 902; s c., 87 App. Div. 459, 84 N. Y. Supp. 851; Masons’ Supplies Co. v. Jones, 58 App. Div. 231, 68 N. Y. Supp. 806, affirmed 172 N. Y. 598, 64 N. E. 1123; Nussberger v. Wasserman, 40 Misc. Rep. 120-125, 81 N. Y. Supp. 295. The plaintiff alleged that Kieley completed the contract as assignee of the Barron & Cooke Company. Kieley, in his answer, admits that he completed the work, but denies that he did so as assignee of his principal. He neither alleges that he completed it under a new and independent contract with AVood or the Fidelity and Bonding Companies, whom AVood represented, nor did. he demand a personal judgment against them. His •only prayer for relief is that the complaint be dismissed “and that he have such other and further relief in the premises as may be warranted by the proofs adduced at the trial.” Having filed no lien, he was entitled to any part of the fund which was the subject of the litigation, because that fund, barring the statutory rights of lienors, was due and payable to the contractors; and, having failed to demand a personal judgment against the Fidelity and Bonding Companies, or a determination of any controversy between him and them, they had no notice that he would demand such judgment, and he was not entitled thereto, even if he had served his answer upon them, which does not appear. Code of Civil Procedure, §. 521; Kane v. Hutkoff, 81 App-. Div. 105, 81 N. Y. Supp. 85. There was no express waiver by them of their right to a jury trial of his claims against them. It is contended that the Fidelity and Bonding Companies and AVood voluntarily litigated Kieley’s claim as against them, and that this constituted an implied waiver of service of an answer containing a demand for personal judgment and of the right to a jury trial, and brings the case within the well-settled rule that parties may voluntarily litigate, an issue not presented by the pleadings. Frear v. Sweet et .al., 118 N. Y. 454, 23 ,N. E. 910; Grifhahn v. Kreiser, 62 App. Div. 413, 70 N. Y. Supp. 973, affirmed 171 N. Y. 661, 64 N. E. 1121. If,. however, the evidence received and proceedings had, which it is claimed constitute the waiver, were pertinent to any issue presented by the pleadings, it should be held, in the absence of any other fact or ■circumstance clearly- indicating the contrary, that the evidence was received and the proceedings were had with respect to the issue formally presented. Mason’s Supplies Co. v. Jones, 58 App. Div. 231, 68 N. Y. Supp. 806. See, also, Caponigri v. Altieri, 165 N. Y. 255, 59 N. E. 87. If the liens filed by plaintiff and by defendant Dan- • iels were sustained against this fund as asserted, Kieley being a party, the judgment would be a bar to an action by him against AVood or the Fidelity and Bonding Companies pro tanto, for it is alleged that the fund was earned by the work performed by him. . Kieley was therefore interested in having it adjudicated that the fund was not subject to the liens. Evidence elicited by him on the cross-examination of witnesses, produced by the lienors or adduced in his own behalf on that issue, would not be notice to the Fidelity and Bonding Companies that he was establishing a basis upon which he might be awarded a personal judgment against them. The Fidelity and Bonding Companies were entitled to receive all of this fund from the city, but for the liens, regardless of their individual liability to Kieley or others. They were therefore interested in showing that the liens did not attach to any of this fund or to only a small part of it which would entitle them to draw it all, or the part not subject to the lien. Evidence was offered by them tending to show that they were obliged to expend large sums in altering and repairing that part of the work done by the Barron Sr Cooke Company to conform it to the contract and have it accepted by the city, and likewise in completing work left unfinished by Kieley. Neither the evidence introduced by them on those points, nor that introduced by Kieley tending to show that all or part of the work done by them, which they sought to charge up to the contract, was extra work not embraced in the contract, can be said, in the circumstances, to have constituted a voluntary litigation as between them and Kieley of a personal claim by him against them. The evidence was all admissible on the issue tendered by the plaintiff, and consequently there was no implied consent to submit to the court the question as to the personal liability of the Fidelity and Bonding Companies to Kieley.

The further contention that the judgment should be sustained upon the ground that the court was empowered by section 5403 of the Code of Civil Procedure to determine the equities between the parties and that at the close of the case the parties acquiesced in the announcement of the court’s intention to determine the equities between the defendants is not tenable. Counsel were justified in inferring that the court contemplated nothing more than what was authorized by said section of the Code of Civil Procedure, and that only authorizes an adjudication upon equitable claims and confers no authority to award judgment upon legal claims like that of Kieley. Alyea v. Citizens’ Savings Bank, 12 App. Div. 577, 42 N. Y. Supp. 185, affirmed 162 N. Y. 597, 57 N. E. 1103.

Second. The judgment dismissing the liens of the plaintiff and of defendant Daniels is erroneous, and the)- are entitled to a reversal. The findings that Kieley did not undertake to complete the contract as surety, and that he acted under a new and independent contract, are, if supported at all by evidence, against the weight of the evidence; and the conclusion of law that he is, therefore, entitled to the fund, is erroneous. Pursuant to the terms of the contract, Wood gave Kieley notice of the default of his principal and called upon him to perform. Kieley had an interview with Wood as the result of that notice. He did not decline to perform as surety. He knew that if he did not perform, Wood could complete and charge the cost, over and above the balance unpaid on the contract to him. Both he and Wood expressly testified that he elected to and did undertake to perform as surety. This was his right under the principles of subrogation, and Wood acquiesced in it. Wood said to him that if he did so he would be paid the balance of the contract price the same as his principal would if it had completed. The testimony of Wood that "Mr. Kieley elected as surety to complete the work under the Barron & Cooke- contract, and I was to pay him the same as I would have paid the Barron & Cooke people if they had continued,” was not destroyed by his previous answers in the affirmative to two leading questions reciting that an arrangement or agreement was made between him and Kieley, whereby the latter was to complete the unfinished work, “taking as his pay the balance that was or would be due,” or “the amount not in excess of the amount” that the Fidelity and Bonding Companies were obliged to pay under the Barron & Cooke contract, nor by his subsequent answer in the affirmative to two leading questions reciting “that, in substance, at that time a new agreement was made between you and Mr. Kieley and you were to pay him not in excess of the amount that you would have to pay to the Barron & Cooke Heating & Power Company had they completed,” and “it was under that agreement so made between you and Mr. Kieley that Mr. Kieley went ahead and did 'what he did there, was it not?” After the interview between Kieley and Wood, Kieley’s attorney wrote a letter to Wood, which was not introduced in evidence. It evidently was confirmatory of Kieley’s verbal election to proceed with the work, as surety, for Wood’s letter in answer thereto contains the following recital: “I have your letter of September 6, 1902, notifying me on behalf of your client, Mr. Timothy J. Kieley, of his election to complete or have completed the contract of the Barron & Cooke Heating & Power Company, for- the steamfitting at the new city prison, on which Mr. Kieley is bondsman.” ( This evidence, in view of the fact that the letter from Kieley’s attorneys to Wood was not produced, and in view of the further fact that Kieley himself was called by plaintiff and testified that to the best of his knowledge he completed the work under his contract of suretyship and gave no testimony modifying it, required a finding that he proceeded with the work as surety. Doubtless Kieley was under no legal obligation to the lienors to complete the work; but, when he elected to complete it as surety, to protect himself against liability on his contract of suretyship, it is in law deemed a completion by his principa), and the rights of the lienors attach to the fund 'upon the theory that it has been earned under the contract in the performance of which they furnished labor or material. The lien covers moneys due and to grow due under the contract; and, if the principal had completed, he would not have been entitled to the balance until the liens were paid, and, when the surety completes as such under the same contract, he merely steps into his principal’s shoes, and is entitled to receive what the latter, would have received had he completed, and in any view of the evidence that is all that Wood agreed to give him. Heckmann v. Pinkney, 81 N. Y. 211, 217; Harley v. Mapes-Reeve Construction Company, 33 Misc. Rep. 626, 68 N. Y. Supp. 191; Knapp v. Swaney, 56 Mich. 345, 23 N. W. 162, 56 Am. Rep. 397. See, also; Smith v. Lange, 81 App. Div. 192, 80 N. Y. Supp. 1078. The case of Bear Lake Irrigation Co. v. Garland, 164 U. S. 1, 17 Sup. Ct. 7, 41 L. Ed. 327, is distinguishable upon the ground that no mechanic’s lien was there involved, and an assignee of part of the fund to become due under a government contract was denied priority, over the surety who-completed on the default of his principal, upon the ground that the assignment being void at law, the question depended upon the priority of the equities, and that the surety’s equitable right to complete in case his principal defaulted accrued when the contract was made. Nor is this express evidence that Kieley completed as surety destroyed by the fact that it appears that Wood served a notice upon the Barron & Cooke Company pursuant to the contract, assuming to cancel it for their failure to proceed with due diligence. Wood’s negotiations with Kieley were upon the theory that Kieley had a right, as surety, to complete the contract, notwithstanding the notice to the contractor, and in fact it appears that after giving the notice Wood consented to an assignment of the contract by the Barron & Cooke Company to Kieley, as if it were still of full force and effect, and there is evidence tending to show that it was so assigned'. No question was raised upon the trial with respect to plaintiff, having alleged that Wood completed as assignee and proved that he completed as surety, and it is quite .immaterial because in either event the liens would attach to the fund earned. Smith v. Lange, supra.

It is not necessary to decide whether the defendant Daniels should have served her answer on the Fidelity and Bonding Companies, as if she had brought an affirmative action to foreclose her lien. See Code of Civil Procedure, § 521. The defendant Daniels had filed a lien and proved her claim, and in the final submission of the case the court, in effect, announced that the equities between the defendant, would be decided, and no objection was taken thereto. Frear v. Sweet, supra; Grifhahn v. Kreiser, supra; Born v. Schrenkeisen et al., 110 N. Y. 55, 17 N. E. 339. We cannot therefore accede to the demands of the Fidelity and Bonding Companies, and affirm as to appellant Daniels. There must be a reversal of the Kieley judgment in favor of the other appellants, and we think it should be in favor of appellant Daniels as well.

The objection now raised that her answer has not been served on her codefendants against her right to a judgment of foreclosu're, with' leave to sue the principal and surety on the undertaking given to discharge her lien, may, if deemed fatal, be obviated before the new trial. Some parts of the opinion in Martin v. Flahive, 112 App. Div. 347, 98 N. Y. Supp. 577, appear to be inconsistent with these views, but they were not essential to the decision. There a lienor of a subcontractor sued to foreclose his lien. The subcontractor had failed to complete, and the general contractor then undertook to complete on account of his subcontractor. He, too, failed to complete, and then the owner performed on his account. It was held that the lien attached to the surplus owing to the contractor after deducting the cost of completion. The court, however, observed that the position of the general contractor in taking charge and completing was the same as if they had been the assignee of their subcontractor’s contract or his sureties, and cited among other authorities therefor Harley v. Mapes-Reeve Construction Company, supra, an opinion written by the same justice, which held that, where a surety completes, the lien attaches to the entire balance unpaid, without deduction for the cost of completion, and Smith v. Lange, supra, where this ' court held the same as between a lienor and the assignee of the contractor.

Third. The court was not warranted in decreeing a judgment of foreclosure of the Pierce Company’s lien without the presence of the Eddy Company, the subcontractor for whom it did the work and furnished the material. The judgment, although in form only against the city, is conclusive against the Fidelity and Bonding Companies as to the validity of the Pierce Company’s lien and as to the amount thereof, which purports to represent the indebtedness from the Eddy Company to it, and cannot be questioned in the action on the undertaking against the Fidelity and Bonding Companies and their surety, which the judgment authorizes, and such is the effect of the covenant in the undertaking. Mertz v. Press, 99 App. Div. 443, 91 N. Y. Supp. 264, affirmed 184 N. Y. 530, 76 N. E. 1100; Ringle v. Matthiessen, 10 App. Div. 274, 41 N. Y. Supp. 962, affirmed 158 N. Y. 740, 53 N. E. 1131. See, also, McDonald v. Mayor, 113 App. Div. 625, 99 N. Y. Supp. 122. Although the statute does not require that the contractor be joined as a defendant in an action to foreclose a mechanic’s lien, it is manifest that he is a proper jp'arty, and it has been so held' by the Court of Appeals. H. B. C. Co. v. N. Y. C. & H. R. R. Co. et al., 145 N. Y. 390, 40 N. E. 86. It would seem, also, that since the lien is claimed upon a fund primarily due to the contractor and subcontractor they are necessary parties to an action by a lienor of the subcontractor to foreclose his lien in the sense that the court should not undertake to determine the plaintiff’s claim to a fund due to them without hearing them, because, although the judgment would not be binding upon them, such course might lead to a multiplicity of suits and to conflicting determinations with respect to the validity of the lien, or the amount due to the lienor, and might subject the owner or city or the general contractor to a double liability to the lienor and to the subcontractor as well, and therefore there could not be a complete and final determination of the controversy binding on all parties in interest. H. B. C. Co. v. N. Y. C. & H. R. R. Co. et al., supra; Sullivan v. Decker, 1 E. D. Smith, 699. See, also, Pierce, Butler & Pierce Mfg. Co. v. American Bonding Co., 118 App., Div. 662, 103 N. Y. Supp. 678; Scherrer v. Music Hall Company (Com. Pl.) 18 N. Y. Supp. 459; Brandt v. Radley et al. (Sup.) 23 N. Y. Supp. 277. If the Pierce Company had served its answer on the Fidelity and Bonding Companies, and the latter had not taken the objection by demurrer or answer that the Eddy Company should have been joined, they doubtless would have waived their right to that relief (Code Civ. Proc. §§ 488, 489; Scrantom v. Farmers’ & Mechanics’ Bank, 24 N. Y. 424); but the answer was not so served, and they timely drew the matter to the attention of the court on the trial before any evidence was offered in favor of the Pierce Company, and contended, among other things, that, inasmuch as the answer was not served upon them, and the Eddy Company, against whom the Pierce Company was obliged to establish its claim, was not a party, the latter company could have no affirmative relief. The Fidelity and Bonding Companies contend that they had no notice of the lien, as it was not required to be served upon them, and that the mere designation of the Pierce Company as a party defendant and allegation in the complaint that it has or claims some lien upon the fund was not notice to them” and afforded them no opportunity to protect their rights by having the Eddy Company, which might -dispute the claim of the Pierce Company, and which, not being a party, will not be bound by the judgment and may maintain an action and recover on the same claim against them, brought in as a party defendant; and they duly objected to the evidence upon the same ground, and at the close of the evidence they moved upon the same ground, that the lien be dismissed and excepted to the denial of the motion. The only reference to the Pierce Company in the complaint is a general allegation that it and certain other defendants “have or claim to have some interest or property in or lien upon the said moneys which were in the possession of the city of New York applicable to the construction of the public improvement aforesaid.” The lien and claim of the Pierce Company not being set forth and admitted in the complaint could not be deemed uncontested by the other defendants, and it was therefore required to set forth its lien in its answer, or, by virtue of the express provisions of section 3402 of the Code of Civil Procedure, it would have been deemed waived. Unless moneys were due to the Eddy Company, the Pierce Company, its subcontractor, could have no lien, and therefore its answer set up no cause of action, without alleging the facts which it was essential for it to prove. Ball & Wood Co. v. Clarke et al., 31 App. Div. 356, 52 N. Y. Supp. 443; Siegel v. Ehrshowsky, 46 Misc. Rep. 605, 92 N: Y. Supp. 733; Brainard v. County of Kings, 155 N. Y. 533, 50 N. E. 263.

The learned counsel for the Pierce Company maintains broadly that neither1 contractors ñor subcontractors are necessary parties to the action. The Fidelity and Bonding Companies were not only interested as claimants to the fund adversely to the Pierce Company, but they as contractors had bonded the lien and thereby became the real parties in interest, and the city, having no further interest, was not a necessary party to this action which was thereafter brought, nor would it have been a necessary party to an action thereafter brought by the Pierce Company to foreclose its lien. Code Civ. Proc. § 3402; Mertz v. Press, supra; Hawkins v. Mapes-Reeve Construction Co., 82 App. Div. 72, 81 N. Y. Supp. 794, affirmed 178 N. Y. 236, 70 N. E. 783. But the Fidelity and Bonding Companies, who executed the bonds as principals, were the contractors who, on a literal reading of the statute, which has not been adhered, to in all cases, were the only parties authorized to execute it. The foreclosure of the lien before the substitution of an undertaking for the fund affects a fund to which they are primarily and presumptively entitled as against lienors, and after such substitution conclusively adjudicates their lia- " bility, which can only be after they have had their day in court. This judgment establishes the claim and lien of the Pierce Company against a fund presumptively earned by the Eddy Company; and, if the lien had not been discharged, the judgment would have awarded the fund to the Pierce Company as against the Fidelity and Bonding Companies, who may still be held liable for the same moneys to the Eddy Company and to the other lienors, but they would have an opportunity to be heard in each action, whereas, if the foreclosure is allowed after the lien has been bonded ánd they are not brought in, they will be bound by the judgment without being heard. It may be said that in exacting the undertaking they take that chance, but that would be a harsh construction. The only theory upon which the Pierce Company would have been entitled to part of the fund, and could have been entitled to the judgment which it has obtained, is that it has established its claim against the Eddy' Company, which is not a party to the suit. Manifestly that question should not have been litigated in this action as against the Fidelity and Bonding Companies without the presence of the Eddy Company, so that it would be bound by the judgment. A lienor, of the contractor with the owner or city is obliged to allege and show, not only the amount due to him from the contractor, but also that there was money due and payable to the contractor at the time the lien was filed, or that money subsequently became due and payable tó him under the contract; and the lienor’s claim is limited by the amount due or that subsequently becomes due to the contractor. Larkin et al. v. McMullin et al., 120 N. Y. 206, 24 N. E. 447; Van Clief et al. v. Van Vechten, 130 N. Y. 571, 29 N. E. 1017; Ball & Wood Co. v. Clarke et al., supra; Freese et al. v. Avery, 57 App. Div. 633, 69 N. Y. Supp. 150. Likewise, the lienor of a subcontractor is obliged to show, not only the amount due from the subcontractor to him, but also that moneys have become due from the contractor to the subcontractor which were not paid prior to the filing of the lien, because the lienor of the subcontractor claims in the right of the subcontractor; and, under our system of pleading, it is incumbent on the plaintiff, or on a defendant asserting an affirmative claim, to allege all facts essential to his right to recover. Crane v. Genin, 60 N. Y. 127; Lombard v. Syracuse B. & N. Y. R. Co., 55 N. Y. 491; Hagan v. Amer. Baptist Home Mission Society et al., 6 N. Y. St. Rep. 212; Van Clief v. Van Vechten, supra; French v. Bauer, 134 N. Y. 548, 32 N. E. 77, 20 L. R. A. 560; Smack v. Cathedral of Incarnation, 31 App. Div. 559, 52 N. Y. Supp. 168; Beardsley v. Cook, 143 N. Y. 143, 38 N. E. 109; Beecher v. Schuback, 1 App. Div. 359, affirmed 158 N. Y. 687, 53 N. E. 1123. In H. B. C. Co. v. N. Y. C. & H. R. R. Co., supra, the contractor had been paid in full, but the court held in an áction by the lienor against the owner that he was a proper party and should be brought in. Since' by virtue of the provision of the undertaking (Mech. Lien Law, § 20 [Laws 1897, p. 524, c. 418, as amended by Laws 1902, p. 76, c. 37]) the judgment would necessarity be conclusive as to the validity and the amount of the lien in an action on the undertaking, it is evident that, while the judgment is in form only against the city, it is in substance and effect a determination of the ultimate rights between the-Pierce Company and the Fidelity and Bonding Companies, the contractors, for a recovery on the undertaking will follow on mere formal proof. If neither contractor nor subcontractor is a necessary party,, even where a contractor has given a bond to discharge the lien, them the lienor might recover a judgment by default, which would be conclusive upon the contractor as principal upon the bond, for the city might and probably would make default. It would seem, therefore, that section 521 of the Code of Civil Procedure should be construed as requiring that the contractor should be brought in, and the court should not have heard evidence tending to establish the lien of the Pierce Company against the contractors without the presence of the Eddy Company, and should have ordered that company brought in. Jewett v. Schmidt, 45 Misc. Rep. 34, 90 N. Y. Supp. 848; Osterhoudt v. Bd. of Supervisors, etc., 98 N. Y. 239; Steinbach v. Prudential Ins. Co., 172 N. Y. 471, 65 N. E. 281; Armstrong v. Fitch, 113 App. Div. 317, 99 N. Y. Supp. 471; Cook v. Lake, 50 App. Div. 92, 63 N. Y. Supp. 818; Bauer v. Parker, 82 App. Div. 889, 81 N. Y. Supp. 995; Oishei v. Penn. R. Co., 101 App. Div. 473, 91 N. Y. Supp. 1034; Id., 110 App. Div. 709, 97 N. Y. Supp. 447; Morton v. Tucker, 145 N. Y. 244-249, 40 N. E. 3.

It would seem, also, although it is not- now necessary to decide the proposition, that the answer of a lienor setting up his lien and claim, and demanding a judgment of foreclosure which would entitle him to part of the fund or become the basis of an action on the bond, even though no personal judgment be demanded, should be served on the contractor and subcontractor when' made parties to the suit. Otherwise, they have no notice of the claim to enable them to litigate it, and the judgment demanded is, in effect, a determination of the ultimate rights between defendants. Code Civ. Proc. § 521. In Wilson v. Niagara City Land Co., 79 Hun, 162, 29 N. Y. Supp. 517, two justices expressed the opinion that a defendant lienor was not required to serve his answer setting up his lien upon the owner, but the positions of owner and contractor are quite different. In Ostrander v. Hart et al., 130 N. Y. 406, 29 N. E. 744—not an action to foreclose a mechanic’s lien, however—it was decided that a judgment against the plaintiff in favor of one defendant determines nothing as between the defendant and a codefendant, unless the answer was served upon the codefendant. See, also, Savage v. City of Buffalo, 49 App. Div. 577, 63 N. Y. Supp. 477; Balch v. City of Utica, 42 App. Div. 567, 59 N. Y. Supp. 516; Freeman on Judgments (4th Ed.) § 158; 2 Black on Judgments (2d Ed.) § 599; Edwards v. Woodruff, 90 N. Y. 396; Albany City Savs. Inst. v. Burdick, 87 N. Y. 40; Beveridge v. N. Y. E. & R. Co., 112 N. Y. 1, 19 N. E. 489, 2 L. R. A. 648; Stephens v. Hall, 2 Robertson, 674; Tracy v. N. Y. Steam Faucet Co. 1 E. D. Smith, 349-355. If on the trial the plaintiff had consented to discontinue the action, or to a dismissal of the complaint, it is difficult to see how any issue would remain to be tried, if the answeringlienors had not served their answers upon the contractor, who, owing to the fact that the lien had been transferred to the undertaking, was the only party in interest. If the answer of the Pierce Company, asserting its lien and demanding judgment on its claim, had been served on the Fidelity and Bonding Companies, and they had not taken the objection that the Eddy Company should be brought in by answer or demurrer, they might, strictly speaking, have lost their right to complain; but, without service of the answer upon them, they had no notice of the Pierce Company’s claim, and they could only have brought the matter to the attention of the court as they did. It may also be observed in passing, although not strictly essential to the decision, that the objection taken by the Fidelity and Bonding Companies that the answer of the Pierce Company did not state a cause of action, in that it did not state that any money was due or owing from them to the Eddy Company, with which the Pierce Company contracted at the time the lien was filed, or that any money subsequently became due to it, was well taken. Ball & Wood Co. v. Clarke, supra; Siegel v. Ehrshowsky, supra; Leiegne v. Schwarzler, 10 Daly, 547; Lemieux v. English, 19 Misc. Rep. 545, 43 N. Y. Supp. 1066; Bradley v. Cook, supra; Brainard v. County of Kings, supra; Butler v. Aquehonga Land Co., 86 App. Div. 439, 83 N. Y. Supp. 874; Wright v. Roberts, 43 Hun, 413, affirmed 118 N. Y. 672, 23 N. E. 1145.

Fourth. The other lienors should also have been brought in. Formerly, an action to foreclose a mechanic’s lien might have been brought against the owner -alone, and prior lienors were not necessary parties unless the plaintiff questioned the validity or priority of their liens; but subsequent lienors who desired to contest the validity or priority of the plaintiff’s lien might have been admitted as parties on their own motion. Sullivan v. Decker, supra; Foster v. Skidmore, 1 E. D. Smith, 719; Kaylor.v. O’Connor, 1 E. D. Smith, 672; Kenney v. Apgar, 93 N. Y. 539. Later, by section 1; c, 342, p. 585, of the Laws of 1885, subsequent lienors and incumbrancers were required to be made parties in an action brought to foreclose a lien in a court of record. Brown v. Danforth, 37 App. Div. 321, 55 N. Y. Supp. 825; Egan v. Laemmle, 5 Misc. Rep. 224-227, 25 N. Y. Supp. 330. Now, however, by an éxpress provision of the Code, all lienors, whether prior or subsequent, are declared to be necessary parties to such an action in a court of record (Code Civ. Proc. § 3402), and, even if omitted by mistake or through an irregularity in indexing the liens, they must be brought in on motion by the plaintiff, or by order of the court on its own motion (Cass v. Souther, 46 App. Div. 256, 61 N. Y. Supp. 305, affirmed 167 N. Y. 604, 60 N. E. 1111; Hinkel v. Sullivan, 108 App. Div. 316, 95 N. Y. Supp. 788). The same parties are necessary to the foreclosure of a lien, after a bond or undertaking has been substituted for the fund, as to all lienors, as if the fund had not been paid over (Von Den Driesch v. Rohrig, 45 App. Div. 526, 61 N. Y. Supp. 341; Scherrer v. Music Hall Co. [Com. Pl.] 18 N. Y.Supp. 459) ; but, as already seen, it has been held as to municipal liens that, where an undertaking has been substituted for the fund, the city is not ordinarily, at least, a necessary party (Hawkins v. Mapes-Reeve Construction Co., supra). The necessity for making the lienors parties is not dispensed with by proof that actions have not been begun for the foreclosure of the liens within the time limited by statute as extended by the court, where an undertaking has been substituted for the fund, because in such cases it has been held that the statutory limitation contained in the mechanic’s lien law is not applicable. Hafker v. Henry, 5 App. Div. 258, 39 N. Y. Supp. 134; Mertz v. Press, supra.

It follows that the judgment, in so far as it has been appealed from, should be reversed, and a new trial granted, with separate bills of costs to the appellants, appearing separately, to abide the event.

PATTERSON, P. J., and CLARICE and SCOTT, JJ., concur. INGRAHAM, J., concurs in result.  