
    Francis J. Maneely, as Administrator, etc., of John Maneely, Deceased, Lienor, Appellant, v. The City of New York and Others, Defendants, Impleaded with United States Fidelity and Guaranty Company, Principal and Contractor, and Others, Appellants, Impleaded with Timothy J. Kieley, Surety, and George F. Tremain, as Trustee in Bankruptcy for Frank M. Pierce Engineering Company, Respondents.
    First Department,
    May 17, 1907.
    . Mechanic’s lien— when judgment at law in favor of defendant lienor not . authorized — when surety completing work of sub-contractor not entitled to personal judgment in action of foreclosure — when con-; tractor and sub-contractor necessary parties'—other lienors necessary parties. ;
    A surety of a sub-contractor for . a municipal improvement who completes, the contract on the default of his principal under an agreement that he is to receive the balance unpaid on the contract and who flies -no lien, cannot, as defendant in an action to foreclose liens filed by other parties, recover a personal'júdgment against the sureties of the original contractor. Such judgment in such ■ action cannot be based upon a finding that the completion of the work was under a new and independent contract; this, because the action to foreclose brought by other lienors is equitable in its nature, and a sub-contractor made a codefendant cannot have a' judgment at law unless the other parties waive their right to a jury trial.
    Evidence elicited by such defendant on the cross-examination of witnesses produced by lienors is not notice to the surety of the original contractor that he is ' establishing the basis for a personal judgment against it, and is not a consent to submit to the court the question of personal liability.
    ‘The power of the court under section 3403 of the Code of Civil Procedure to determine the equities between all parties does not authorize an adjudication upon a legal claim.
    3h such action it is error to dismiss the liens of the plaintiff and other defendants upon a finding that one defendant, who is surety for a defaulting contractor, completed the work under a new and independent contract, which finding is against the weight of evidence.
    "When the surety for a sub contractor in order to protect himself against liability completes the work, it is deemed in law a completion by his principal, and the rights of- lienors attach to the fund upon the theory that it has been earned under the contract in performance of which they furnished labor or material. When the surety completes 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. .
    ZBvidence that a surety completed his principal’s contract as such is not destroyed, by the fact that notice was served on the principal canceling the contract for failure to proceed with diligence.
    3n an action of foreclosure by the lienor of one sub-contractor the lienor of other sub-contractors who have not been made parties is not entitled to a judgment of foreclosure against their sureties. Such judgment though'in form only against the owner (a municipality) and not res adjudícala as - against the sureties would lead to a multiplicity of suits and the possibility of-conflicting " adjudications. Hence the parties, against whom the lien is claimed are necessary parties.
    The fact that a lienor is made a party to foreclosure by another lienor as one having or claiming to have an interest in the fund in controversy does not authorize a judgment in-his favor against, persons liable on an undertaking given to discharge the lien who have not been served with an answer alleging facts establishing the lien;
    I-n an action, to foreclose a mechanic’s lien all lienors whether prior or subsequent ' to the plaintiff are necessary parties when the action is brought in a court of record. This is so, even though an undertaking or bond has been given, to discharge the lien.
    '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.
    
      .. Separate appeals- by the plaintiff, Francis J. Maneely, as admin- - istrator, etc., and by the défendants, the United States Fidelity and Guaranty Company and others, from portions of a judgment of the Supreme Court, entered in the office.of the clerk of the county of New York on .the 3d day of February, 1906, upon the decision of the court rendered after a trial at the New York Special Term. .
    
      John F. McCann, Jr., for the plaintiff, appellant.
    
      Leonidas Dennis, for the appellants the United States Fidelity and Guaranty Company and'Charles Francis Wood.
    
      Perry D. Trafford, ' for the appellant. American Bonding Company. '
    
      Horace A. Davis, for the appellant Catherine Daniels.
    - Deary Fmery, . for the respondent Tremain, as trustee, etc. , ■
    
      CJia/rles J. Hardy, for the respondent Kieley.
   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 & > Bolton Company and the city of New York,, bearing date, .the 20th. day of April, 1899, for the construction of the high and low-pressure steam plant, dynamo and electric lighting plant and. .'kitchen in the new city prison at Centre, Franklin and Leonard streets, for tile gross sum of $93,325. The Armstrong &.Bolton Company abandoned the work and the fidelity and bonding companies performed it as sureties. " ,

The Armstrong & Bolton 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 duly authorized. agent, and, in his name, made a sub-contract.with the Barron & Cooke Heating and Power Company, which will be referred to as the Barron & Cooke Company, on the 24th day of April, 1901, for completing the stéamfitting 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 Parrón & 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 Parrón & Cooke Company, pursuant to the contract, that unless it prosecuted the work diligently and tb 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, hut 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 Parrón & 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 materia] and performed labor for the Parrón & Cooke Com-. pany, 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 aetion, bec&us& he filed ho 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.

Wbod, 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. nntil 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 and. 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 thereof 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 expressly 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 fas 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.

■ Heither the Eddy Company, under whose contract the plaintiff makes no claim, nor its sub-contractor 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 hen, 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; S. C., 87 id. 459 ; Masons' Supplies Co. v. Jones, 58 id. 231; affd., 172 N. Y. 598 ; Nussberger v. Wasserman, 40 Misc. Rep. 120,125.) The plaintiff alleged that Kieley completed the contract as assignee of the Barron & Cooke Company. Kie'ley, 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 Wood of the fidelity and bonding companies, whom Wood represented, nor did he demand a personal judgment against them. His only prayer for relief is that the complaint be dismissed and. that lie have such other and further relief in the premises as may seem just and proper and as may be warranted by the proofs adduced at the trial.” Having filed no. lien he was not 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 Civ. Proc. § 521; Kane v. Hutkoff, 81 App. Div. 105). 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 Wood voluntarily litigated Kieley’s claims 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, 118 N. Y. 454; Grifhahn v. Kreizer, 62 App. Div. 413; affd., 171 N. Y. 661.) If, however, the evidence received and pro- ' ceédings 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 circumstances clearly indicating the contrary, that the evidence, was received and the proceedings were had with respect to the issue formally presented. (Masons' Supplies Co. v. Jones, 58 App. Div. 231. See, also, Caponigri v. Altieri, 165 N. Y. 255.) If the liens filed by plaintiff and by defendant Daniels were sustained against this fund as asserted,. Kieley being a party, the judgment would be a bar to an action by him against Wood 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 & Cooke Company to conform it to the contract and have it accepted by the city, and likewise in completing Work left unfinished by. Kieley. Heither the evidence introduced by them on these 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 3403 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; affd., 162 N. Y. 597.)

Second, The judgment dismissing the liens of the plaintiff and of defendant Daniels is erroneous, and they 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 ail 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 arid Wood acquiesced in 'it. Woodi said to. him that if lie 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 Barrón & Coolce 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 workjtaking as his pay the balancé' 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 : “ Tha.ttin substance, at that time a new agreement was made between ■ you. and Mr. Kieley whereby- this work was to be completed by 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 Co. had they completed,” and “ It was ' under that , agreement so made between you aiid 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 attorneys 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 6th, 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 Mew 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 pro- ■ dnced, 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 lie-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 sh'-rety,- to protect himself" against liability on his contract of suretyship, it is in law deemed a completion by his principal, 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. T. 211, 217; Harley v. Mapes Reeves Construction Co., 33 Misc Rep. 626 ; Knapp v. Swaney, 56 Mich. 345. See, also, Smith v. Lange, 81 App. Div. 192.) The case of Bear Lake Irrigation Co. v. Garland (164 U. S. 1) 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 assign- ' mént 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 Civ. Proc. § 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 defendants would ■ be decided, and no objection was taken thereto. ■ (Frear v. Sweet, supra; Grifhahn v. Kreizer, supra; Born v. Schrenkeisen, 110 N. Y. 55.) 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 foreclosure, 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. Fiahive (112 - App. Div. 347) appear to he inconsistent with these views, but they were not essential to the decision. There a lienor of a sub-contractor sued to foreclose his lien. The sub-contractor had failed to complete, and the general contractor then undertook to" complete on account of his sub-contractor. 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 sub-contractor’s contract or his sureties, and cited /among other authorities therefor, Harley v. Mapes Reeves Construction Co. (supra), an opinion written by the same justice, which held that where a surety com- . pletes, 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 sub-contractor 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; affd., 184 N. Y. 530; Ringle v. Matthiessen, 10 App. Div. 274; affd., 158 N. Y. 740. See, also, McDonald v. Mayor, etc., of N. Y., 113 App. Div. 625.) 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 party and it lias been so held by the.Court of Appeals. (Hilton B. C. Co. v. N. Y. C. & H. R. R. R. Co., 145 N. Y. 390.)"' It would seem also that since the' lien is claimed upon a fund primarily due to the contractor and sub-contractor, that they are necessary parties to an action'by a lienor of the sub-contractor to foreclose his lien in the sense that the court should riot undertake to deter-x mine 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. determinatjons 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 sub-contractor as well, and, therefore, there could not be a complete. and final determination of the controversy, binding oni all parties in interest. (Hilton B. C. Co. v. N. Y. C. & H. R. R. R. Co., supra ; Sullivan v. Decker, 1 E. D. Smith, 699. See, also, Pierce, Butler & Pierce Mfg. Co. v. Wilson, 118 App. Div. 662; Scherrer v. Music Hall Co., 18 N. Y. Supp. 459; . Brandt v. Radley, 23 id. 277.) If the Pierce Com-, pany 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. Proe. §§ 488, 498, 49.9; 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 pame 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 sub-contractor, 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 and Wood Co. v. Clark & Sons Co., 31 App. Div. 356 ; Siegel v. Ehrshowsky, 46 Misc. Rep. 605 ; Brainard v. County of Kings, 155 N. Y. 538.)

The learned counsel for the Pierce Company maintains broadly that neither contractors nor sub-contractors 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; Hawkinns v. Mapes-Reepe Construction Co., 82 App. Div. 72; affd., 178 N. Y. 236.) 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 liability, which-can only be after they liaye 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 and 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 také 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 Apresen ce 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 su-bse-' quently became due and payable to him under the contract; and the lienor’s claim is limited by the amount, due or that subsequently becomes due to the' contractor. (Larkin v. McMullin, 120 N. Y. 206; Van Clief v. Van Vechten, 130 id. 571; Ball and Wood Co. v. Glm'k Sons Co., Supra ; Freese v. Avery, 57 App. Div. 633.) Likewise, the lienor of a sub-contractor is obliged to show not only the amount due from the sub-contractor to him, but also that moneys have become due from the contractor to the sub-contractor which were not paid prior to the filing of the lien, because the lienor of the sub-contractor claims in the right of the sub-contractór / .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. (Creme v. Qenin, 60 N. Y. 127; Lumbard v. Syracuse, B. do FT. V. B. B. Co., 55 id: 401; Hagan v. Americap, Baptist Society, 6 27. Y. St. Bepr. 212; Van Clief v. Van Vechten, supra; French v. Bauer, 134 27. Y. 548; Smack v. Cathedral of Incarnation,- 31 App. Div. 559; Beardsley v. Conk, 143 27. Y. 143; Beecher v. Schuback, 1 App. Div. 359; affd., 158 N. Y. 687.) In Hilton B. C. Co. v. N. Y. . C. do H. B. B.. B. Go. (supra) the contractor had been paid in full, but the court lield, in an action 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 (Mechanics’Lien Law, § 20), the judgment would necessarily be'conclusive as to the validity and the amount of the lien in an actidn 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 sub-contractor is a necessary party, even where a contractor has given a bond to discharge the lien, then 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 Mise. ■ Rep. 34; Osterhoudt v. Board of Supervisors, etc., 98 N. Y.-239 ; Steinbach v. Prudential Ins. Go., 172 id¡ 471.; Armstrongs. Fitch, 113 App. Div. 317; Gook s. Lake, 50 id. 92; Bauer s. Parker, 82 id. 289; Oishei s. Pennsylvania R. R. Go., 101 id. 473; Oishei s. Metropolitan Streeet R. Go., No. 1, 110 id. 709; Morton s. Tucker, 145 N. Y. 244,' 249.) '

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 sub-contractor 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) 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. Heart (130 N. Y. 406) — 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, No. 1, 49 App. Div. 577 ; Balch v. City of Utica, No. 2, 42 id. 567; Freem. Judg. [4th ed.] § 158; 2 Black Judg. [2d ed.] § 599; Edwards v. Woodruff, 90 N. Y. 396 ; Albany City Savings Inst. v. Burdick, 87 id. 40 ; Beveridge v. N.Y.E.R. R. Co., 112 id. 1; Stephens v. Hall, 2 Robt. 674; Tracy v. N. Y. Steam Faucet Co., 1 E. D. Smith, 349, 354, 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 answering lienors had not served their answers upon the contractor, who, owing to the fact that the lien liad 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. ho notice of the Pierce Company’s claim and théy could only have brought the matter to the attention of .the court as they did. It may also be obsérved 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 ijalien. (Ball and Wood Co. v. Clark & Sons Co., supra; Siegel v. Ehrshowsky, supra; Leiegne v. Schwarzler, 10 Daly, 547, 552; Lemieux v. English, 19 Misc. Rep. 545; Beardsley v. Cook, supra; Brainard v. County of Kings, supra; Butler v. Aquehonga Land, Co., 86 App. Div. 439; Wright v. Roberts, 43 Hun, 413; affd., 118 N. Y. 672.) .

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 neces- ■ sary 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, Id. 672; Kenney v. Apgar, 93 N. Y. 539.) Later, by .section-17 of chapter 342 of the Laws of 1885, subsequent lienor's 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; Egan v. Laemmle, 5 Misc. Rep. 224, 227.) Now, however, by an.express 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. Proe. § 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. (Gass v. Souther, 46 App. Div. 256; affd., 167 N. Y. 604; Hinkle v. Sullivan, 108 App. Div. 316.) 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; Scherrer v. Music Hall Co., supra); but, as already seen, it has been held as to municijjal 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. Mechanics’ Lien Law is not applicable. (Hafker v. Henry, 5 App. Div. 258; 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.

Patteííson, P. J., Clarke and Scott, JJ., concurred; Ingraham, J., concurred in result.

Judgment, in so far as appealed from, reversed, and new trial ordered, costs to apjoellants appearing separately to abide event. Settle order on notice. - 
      
      See Lien Law (Laws- of 1897, chap. 418), § 20, subd. 5, added by Laws of 1898, chap. 169, and amd. by'Laws of 1902, chap..- 37.— [Rep.
     
      
       See Laws of 1897, chap. 418, § 20, subd. 5, added by Laws of 1898, chap. 169, and amd. by Laws of 1902, cha'p. 37.— [Rep.
     