This was an action brought by the defendants in error, John W. Hopper and Edward T. Bartley, co-partners doing-business under the name of Hopper & Bartley, to enforce an alleged mechanics’ lien upon certain real estate of the plaintiff in error, Charles Becker, upon which the plaintiff in error, Henry Becker, held a mortgage; the lien, being claimed for certain -work performed and materials furnished in and about the construction of a building, at the request of and for the firm of Brice & Mitchell, the contractors engaged in constructing said building. The case came to this court on error for review of the judgment entered upon the trial of the action establishing the lien for the sum of $950.27 and costs of suit, including $25 for attorney’s fees. Upon the original hearing in this court the cause was ordered remanded to the District Court with directions to modify the judgment by deducting the sum of $392 from the amount of the lien and striking out the amount allowed as attorney’s fees, and as so modified the judgment was affirmed. (138 Píac. 179.) The plaintiff in error, Charles Becker, filed a petition for rehearing, complaining only of the conclusion stated in the opinion that the plaintiffs in error as defendants below, by failing to raise the objection by answer, had waived the objection that the surviving member of the firm of Brice & Mitchell, the original contractors, had not been brought into the case as a party defendant by proper constructive service. The defendants in error also filed a petition for rehearing, alleging error in the conclusions of the court in three particulars: 1. In holding the statute allowing an attorney’s fee in the case to be unconstitutional. 2. In holding the provisions of Chapter 68 of the Laws of 1911, with reference to the sufficiency of a lien *215statement, inapplicable to this case. 3. In holding that the item of $1,292 was insufficiently described in the lien statement to entitle the parties filing the same to a lien. A rehearing was granted, and the cause has again been heard. A reconsideration of the' points on which a rehearing was asked has failed to convince the court of any error in the previous decision, and the writer hereof, who did not participate in that decision, joins the other members of the court in the view that the conclusions stated in the former opinion should be adhered to. The questions again raised by the petition of the defendants in error are sufficiently discussed in the former opinion, and what was there said as to those questions will be adopted for the purpose of disposing of them- upon this rehearing.
In the petition of plaintiff in error for a rehearing it was stated that the objection that there was a defect of parties through the failure to properly bring the contractor into the case as a defendant was disposed of by the court on a ground not referred to in brief or oral argument or suggested at the original hearing, viz.: that the objection had been waived by the failure to raise it by answer. The argument against the view that the objection was so waived is confined to a review of the Missouri cases on the subject, on the theory that they should be followed here since our mechanics’ lien statute was taken from that state. And it is contended that the effect of the Missouri decisions is to plainly declare it necessary and essential to a valid judgment enforcing a mechanics’ lien that the one with whom the contract for the labor or materials was made by the lien claimant be properly brought into the case as a party defendant, and that where he is not made a party the defect is not waived by a failure to take the objection by demurrer or answer. We are not satisfied that such is clearly the result of the Missouri cases, where the action is brought in a court of record governed in the matter of procedure by the provision of the statute in that state, similar to our own, to the effect that the objection on the ground of a defect of parties is waived unless taken by demurrer or answer. *216(Horstkotte v. Menier, 50 Mo. 158; Johnson-Frazier Lumber Co. v. Schuler & Muench, 49 Mo. App. 90.) In Horstkotte v. Menier, a case decided in 1872, the court said: “What we now hold is that the original contractor ought to be brought before the court as a co-defendant, for the purpose of protecting his own rights and those of the owner. But if he is not so brought before the court at the proper time, the judgment will not for this omission be error or void. The objection should have been taken by the owner by demurrer or answer. If he fails to demur when the defect appears on the petition, or fails to set up the non-joinder by answer when it does not appear on the face of the petition, he will be presumed to have waived the objection. (Wagn. Stat. 1014-1015, Secs. 6, 10.) The defect of parties cannot be reached by way of instruction.” In Johnson-Frazier Lumber Co. v. Schuler & Muench, an action to enforce a mechanics’ lien originally brought before a justice of the peace, the court said: “It is contended by the plaintiff that, although the appealing defendants had the right to have the contractors, Schuler & Muench, made co-defendants and served with process, yet, as that was not done, and as they took no steps before judgment to have it done, that they thereby waived their right. It has been oftentimes decided under our practice act that unless the objection of defect of parties to the record is made, either by demurrer or answer, it will be deemed waived. (Gimbel v. Pignero, 62 Mo. 240; Butler v. Lawson, 72 Mo. 227.) And this rule has been held to apply in actions brought upon mechanics’ liens in courts of record. (Horstkotte v. Menier, 50 Mo-. 158; Fruin v. Furniture Co., 20 Mo. App. 313.) But the statute, Section 2047, upon which the foregoing rule of practice is based, is limited to actions in courts of record, Section 2038, and hence is not applicable to actions brought before justices of the peace.”
Our attention has not been called to any decision of the Supreme Court of Missouri overruling the case of Horst-kotte v. Menier. But we are cited to a case in one of the intermediate appellate courts of that state, viz.: Steinmann *217v. Strimple, 29 Mo. App. 478, wherein the court distinguished Horstkotte v. Menier from the case then under consideration by stating- that the former was a case where the lien claimant was one whose contract had been made with a sub-contractor, so that the original or principal contractor was not one of the “parties to the contract” within the “mandatory provision” of the mechanics’ lien statute that “the parties to the contract shall” be made parties.
The section of the Missouri statute prescribing- the rule as to parties in air action to enforce a mechanics’ lien provides that, “the parties to the contract shall, and all other persons interested in the matter in controversy or in the propert)' charged with the lien may be made parties, but such as are not made parties shall not be bound by any such proceedings.” The provision that the parties to the contract shall be made parties seems to be construed by the courts in that state to refer to the contract under which the lien claimant furnished the labor or materials, whether owner, a contractor or sub-contractor. But whatever may be the effect of the Missouri decisions as to the question of waiver, though the)*-'would be persuasive as authority, they are not controlling, for the reason that while our mechanics’ lien statute, as heretofore declared by this court, appears to have been taken from Missouri, the section of our statute with reference to parties in an action to enforce the lien is not the same as the corresponding section of the Missouri statute, but instead of the provision that “the parties to the contract” shall be made parties, it is declared by our statute that “the parties to the controversy shall * * * * be made parties.” (Comp. Stat. 19x0, Sec. 3806.) The entire section reads as follows :
“In all suits under this chapter the parties to the controversy shall, and all other persons interested in the matter in controversy, and in the property charged in the lien, may be made parties, but such as are not made parties shall not be bound by any such proceeding, and constructive service may be had upon any defendant in suits brought under this chapter who may be non-residents of the state and cannot *218be personally served with the summons within the state in the same manner as constructive service is had in other cases at law.”
The provision for constructive service was added by a re-enactment of the section in 1886. (Laws 1886, Ch. 25, Sec. 4.) Otherwise the section remains as originally enacted in 1877. (Laws 1877, p. 79.) It is argued that while our statute requires that “parties to the controversy” shall be made parties, instead of parties to the contract, the provision is even broader than that of the Missouri statute, and must be held to include the parties to the contract. If that be conceded, we would still not be bound by the Missouri decisions construing the provision of their statute that “the parties to the contract” shall be made parties, for our Legislature did not adopt that provision.
It is unnecessary, therefore, to consider the comparative meaning and effect of the two statutes. But we are to ascertain whether the provision of our statute that “the parties to the controversy” shall be made parties to a suit brought to enforce a mechanics’ lien requires that the contractor shall be made a party to authorize a judgment foreclosing the lien. “Controversy” is defined as “a dispute arising between two or inore persons.” (1 Bouvier’s Law Diet.; 7 Ency. L. (2nd Ed.) 458.) “A dispute; a disputed question-; a dispute arising between two or more persons; a law suit; a suit at law; a civil action or proceeding at law.” (9 Cyc. 813-814.) “A dispute between two or more persons; a civil action or suit, either at law or in equity.” (1 Rapalje & Lawrence’s Law Diet.) It is apparent that in the provision under consideration the word is not used in the sense of a suit, for that would make the provision read that in all suits the parties to the suit shall be made parties, which would be without practical meaning. It is rather to be understood as referring to the dispute, or the disputed question; so that its only force and effect would seem to be that the parties between whom the dispute has arisen shall be made parties. And that, taken literally, might exclude the contractor where there is 110 dispute be*219tween him and the lien claimant. But if a personal j udgment should be sought against the contractor it is clear that for that purpose it would be necessary to' make him a party, although he might not dispute the account. And the owner might not dispute the amount claimed or the right of the claimant to a lien, in the sense of denying the alleged indebtedness or the right to a lien, though requiring before making payment, if only for his own protection, that a suit be brought and judgment obtained establishing the amount due and the lien. Manifestly, to apply this provision of the statute as to parties there must be some criterion for determining what constitutes the “controversy” or dispute. We think that criterion, at the outset at least, is the petition, and that in its averments and prayer, showing the cause of action and the relief sought, the “controversy” is to be found disclosed. If we are right in this interpretation of the provision, and we see no reason to doubt it, the provision adds practically nothing to what the law would be without it, for it does not prescribe or define who shall constitute or be deemed to be the parties to the controversy, but leaves that matter to be determined by the court, in the same manner as though the provision had been omitted from the statute. It certainly has no greater effect than if it had declared that the necessary parties to the controversy, or the parties necessary to the granting of the relief, shall be made parties to the suit. Had either phrase been used the provision would still be lacking in a definition of the term or words employed to designate the persons required to be made parties that could aid the court in determining in any case who are or who are not necessary parties to such a suit. Clearly, therefore, in our opinion, this statutory provision affords no ground for holding that the contractor is such a necessary and indispensable party to the suit that no judgment can be rendered establishing and foreclosing the lien unless he is made a party, or that the failure to make him a party cannot be waived by the owner.
Where the lien is claimed for labor performed for or materials furnished to a-contractor the right to the lien or *220its enforcement does not depend in this state upon the condition of the accounts between the owner and contractor. The fact that there is nothing due from the owner to the contractor will not defeat the lien of such a claimant. Hence there is not the same reason for making the contractor a party as under statutes limiting the lien of a subcontractor, laborer or materialman to the amount due from the owner to the original contractor, or requiring that before the lien can be established the state of the accounts between the owner and contractor shall be adjudicated. But it is provided by our statute (Comp. Stat. 1910, Sec. 3816) as follows:
“In cases where a lien shall be filed under the provisions of this chapter, b)>- any person other than a contractor, it shall be the duty of the contractor to defend any action brought thereon at his own expense, and during the pend-ency of such action the owner or agent may withhold from the contractor the amount of money for which said lien shall be filed, and in case of judgment being rendered against the owner or -his property upon the lien, he shall be entitled to deduct from any amount due by him to the contractor the amount of such judgment and costs, and if he shall have settled in full with the contractor he shall be entitled to recover back from the contractor any amount so paid by the owner for which the contractor was originally liable.”
The provisions of this section were evidently incorporated in the statute for the owner’s protection, and to accomplish the full purpose thereof the owner has a clear right to insist that the contractor be made a party, if possible, so that he may be bound by the judgment. While no personal judgment can be rendered against the contractor in such a suit unless there has been service of summons upon him within the state, he may nevertheless, if a non-resident of the state, be brought in as a party, for the statute has. provided for constructive service in such a case. (Sec. 3806.) And by Section 3809 it is provided that if the debtor has not been personally served with process according to law, but has *221been lawfully notified by publication, the judgment, if for the plaintiff, shall be that he recover the amount of the indebtedness found to be due and the costs of suit, to be levied out of the property charged with the lien. We have no doubt, therefore, that the contractor ought to be made a party, and is a necessary party to the suit in the sense that the owner may require that he be made a party, or by proper and timely objection may defeat the action for a failure to make him a party. But such failure to make the Contractor a party may be waived by the owner, for he is not, in our opinion, an indispensable party to the rendition of a valid judgment establishing and foreclosing the lien.
The terms “necessary” and “indispensable” as applied to parties to a suit are often used without distinction or as meaning the same thing, but such custom ought not, we think, to be taken as implying that all so-called necessary parties are equally indispensable to a valid determination of the suit upon the issues between the.parties before the court. “Indispensable” parties are of course “necessary” parties, but some parties are necessary only in a limited •sense, as where their presence may be required for the protection of some other party to the suit, or to save further litigation, though the distinction is perhaps not of much importance except when applying the rule as to waiver. Referring to the rules in equity upon the subject, the Supreme Court of the United States has classified parties as follows: “1. Formal parties. 2. Persons having an interest in the controversy, and who.ought to be made parties, in order that the court may act on that rule which requires it to decide on, and finally determine the entire controversy, and do complete justice by adjusting all the rights involved in it. These persons are commonly termed necessary parties; but if their interests are separable from those of the parties before the court, so that the court can proceed to a decree, and do complete and final justice, without affecting other persons not before the court the latter are not indispensable parties. 3. Persons who not only have an interest in the controversy, but an interest of such a nature that a *222final decree cannot be made without either affecting that interest or leaving the controversy in such a condition that its final determination may be wholly inconsistent with equity and good conscience.” (Shields v. Barrow, 17 How. U. S. 130, 15 L. Ed. 158.)
That these three classes of parties clearly exist is conceded by the author of the article on the subject in the Encyclopedia of Pleading and Practice, though it is said therein that the terminology seems to be inapt and misleading, since the definition between “indispensable” and “necessary” is not readily apparent, and the two terms are used synonymously in a majority of the'decisions. Therefore, in that article the two classes designated by the Supreme Court as “formal” and as “necessary” parties are treated as subdivisions of the class designated as “proper but not indispensable” parties, and named respectively as “formal or nominal parties” and “parties with separable interests.” And, referring to the latter class it is said: “Parties who are proper but not indispensable include all persons who have an interest in the controversy, but whose interests are separable from those of the parties before the court and will not be directly and necessarily affected by a decree which does full justice between them and is conformable to equity and good conscience. The class corresponds to the class designated ‘necessary parties’ in the classification adopted by the United States Supreme Court.”' (15 Rncy. Pl.. & Pr. 610-611, 651, 653.) However, it is said (page 614) that the term “necessary” parties “includes persons who, while not necessary or indispensable on account of their own interest yet are so connected with the subject matter of the controversy that it is necessary to have them before the court for the proper protection of those whom the decree will necessarily and directly affect”; and (page 690) that “where the parties omitted are necessary only for the purpose of protecting the defendant from further litigation, the court may, in its discretion, disregard the objection if first raised at the hearing,” following a statement of the general rule that the non-joinder of proper but not indispensable parties *223must be raised by plea, answer, or demurrer, and if not so raised the defect is waived and not available at the hearing. This is to be understood, because of the classification employed in the article, as referring to all who are not indispensable parties. Whatever may be the appropriate classification of parties in stating the general rules on the subject, it is clear that there may be persons who are not indispensable but who ought to be made parties, so that where that has not been done the defendant may object, or may waive the defect by failing to object on that ground. Of course no person, whether a necessary or only a proper party, will be bound by a judgment in an action in which he was not a party. If the owner of the property is not made a party in an action to enforce a mechanics’ lien no judgment can be rendered which will bind him or the property; and likewise if the contractor for whom the labor was performed or the materials furnished is not made a party, he will not be botmd by the judgment. In the case of Reformed Presbyterian Church v. Nelson, 35 O. St. 638, it is said: “The proposition that, where no objection is made by demurrer or answer on account of the defect of parties, the objection is to be deemed as waived, applies only in cases where it is competent for the party pleading to waive the objection.” The contractor would not be competent to waive the objection that the owner was hot made a party, so as to authorize a judgment enforcing a lien upon the property, but he might waive the objection so as to permit a valid personal judgment to be rendered against himself for the amount of the indebtedness. So the owner, in our opinion, is clearly competent to waive the objection that the contractor or other subordinate who procured the labor or materials is not made a party, so far as to permit a valid judgment to be entered foreclosing the lien. But the fact of such waiver will not justify a personal judgment against the contractor.
As shown above, the statute does not require that a personal judgment be recovered against the contractor as a prerequisite to the enforcement of the lien. And the fact that he is the debtor does not make him an indispensable party *224to the suit to enforce the lien. His position in that respect is, it-seems to us, analogous to a mortgagor who has disposed of all his interest in the mortgaged property. Notwithstanding that such mortgagor remains the debtor, and the only one personally liable, he is not regarded as an indispensable or necessary party to a suit to foreclose the mortgage, where no personal judgment is sought against him. “A necessary party” in a foreclosure suit “is one whose presence before the court is indispensable to the rendering of a judgment which shall have any effect upon the property; without whom the court might properly refuse to proceed, because its decree would be practically nugatory. The person who in this sense is a necessary party defendant is the owner of the equity of redemption.” (2 Jones on Mort, sec. 1394.) It is further said in the section cited: “To obtain a judgment for any deficiency there may be after the sale, the debtor and any other person who may have assumed the debt are necessary parties; but as the primary object of the suit is to divest the title of the holder of the equity of redemption, and of others interested in it, and to transfer this by sale to a purchaser, the fact that one is personally liable for the debt makes him a proper party, but not in the general use of the term a necessary one.” And in section 1402, it is said that “The mortgagor, if he remains the owner of the equity of redemption, is a necessary party to a foreclosure suit, because without his presence the primary object of the suit, a decree of foreclosure or sale, cannot be obtained. Even if he has wholly parted with his interest in the premises he should be made a party to the bill if a judgment is sought against him for any deficiency of the debt that may remain after applying to it the proceeds of the sale. Therefore, where the laws provide for a judgment for such deficiency' he is always a proper party, though not a necessary one, after he has conveyed his interest, so far as effecting a complete foreclosure of the equity of redemption is concerned. If no personal judgment is sought against the mortgagor, or none can be had, he should not be made a party to the bill after he has ceased to have any interest in *225the subject of the mortgage.” (See also 27 Cyc. 1572; Boutwell v. Steiner, 84 Ala. 307, 4 So. 184; 5 Am. St. Rep. 375; Goodenow v. Ewer, 16 Cal. 461, 76 Am. Dec. 540; Coney v. Winchell, 116 U. S. 227, 6 Sup. Ct. 366, 29 L. E. 610; Ayres v. Wiswall, 112 U. S. 187, 5 Sup. Ct. 90, 28 L. Ed. 693.)
The following cases support the view above expressed that the rule as to waiver of a defect of parties applies in a suit brought to enforce a mechanics’ lien, where the contractor has not been made a party: 27 Cyc. 346, 358; Osborne v. Logus, 28 Ore. 302, 306, 37 Pac. 456, 38 Pac. 190, 42 Pac. 497; Northwestem C. & C. Pavement Co. v. Norwegian &c. Seminary, 43 Minn. 449, 45 N. W. 868; Frederickson v. Riebsam, 72 Wis. 587, 40 N. W. 501; Eberle v. Drennan, 40 Okl. 59, 136 Pac. 162, 51 L. R. A. (N. S.) 68; Luttrell v. Knoxville &c. R. R. Co., 119 Tenn. 492, 105 S. W. 565, 123 Am. St. Rep. 737; Dhignan v. Montana Club, 16 Mont. 189, 40 Pac. 294.
It is, however, argued that the statute requiring the objection to be taken by demurrer or answer should not be held applicable, where the contractor is named in the petition as a party defendant, and the failure to bring him' in as a party results from a defective service by publication. It is contended that in such a case the objection is sufficiently raised by a motion to dismiss, though made during the trial, as in the case at bar. We cannot agree with this contention. The argument that the defendant may not, under such circumstances, be sufficiently advised to raise the objection by answer, since the defect may not be apparent when the answer is due, is unsound, for the reason that it ignores the statutory provisions permitting amendments to pleadings. In Gilland v. U. P. Ry. Co., 6 Wyo. 185, 43 Pac. 508, where it was sought to raise the question of defect of parties by an instruction to the jury, and a motion was made after verdict to amend the answer by adding the defense of a defect of parties, so as to conform the pleadings to the proof, it was said by this court that, “when the testimony of the plaintiff disclosed the facts upon which the defendant was *226willing to rely and maintain its proposition, the objection should have been made at that time, and application then made to amend its answer upon trial, setting forth the facts constituting the alleged defect of parties.” And in Mau v. Stoner, 15 Wyo. 109, 87 Pac. 434, 89 Pac. 466, the allowance of an amendment to the answer at the close of plaintiff’s evidence alleging a misjoinder of parties defendant was held proper, upon a showing that the amendatory- facts were unknown to the defendants prior to the time when the plaintiff rested his case.
If it did not appear until the time of the trial, or during the trial, that the attempted service by publication was defective, the defendants might then have applied for leave to amend their answer so as to set up the defense. As to all but one of the objections urged against the sufficiency of the constructive service the facts were shown by the files of the case before the answer of either defendant was filed. It appears that the petition was filed March 11, 1911, and that summons was issued on that date, which was after-wards returned showing personal service upon Charles Becker and Henry Becker, and that Brice was not found within the county. On March 15, 1911, an affidavit for publication was filed, and thereupon publication was made for service upon Brice in a daily paper for the requisite number of weeks. Proof of the publication was filed November 2, 1911, but the proof was defective for the reason that the affidavit was insufficient in that it was not properly sworn to. After some preliminar)'- motions had been made and the plaintiffs had been permitted to amend the petition by striking out the prayer for personal judgment against Brice, and an averment supporting that prayer, a general demurrer was filed on November 4, 1911. That being disposed of and the petition being again amended, it appears that the answer was filed on December 23, 1911. The trial appears to have occurred on March 13 and 14, 1913. A motion was made at the close of the evidence for the plaintiffs to dismiss the case so far as the attempted enforcement of a lien is concerned upon the ground that Brice, the surviving member of *227the firm of contractors, had not been brought into the case as a party, and had not voluntarily appeared therein; it being alleged in the motion that said Brice had not been, served personally with summons) that prop'er constructive' or other service had not been made upon him, and that the pretended proof of publication filed in the case was void. Thereupon, it appears, that by leave of court over the objection of the défendants another or amended proof of publication was filed.
As shown above, the defective proof of publication had been on the files since November 2, 1911. An .objection based on that defect or any infirmity in the publication itself might, therefore, have been presented by the answer filed several weeks later. One objection urged against the sufficiency of the service is based upon the provision of Section 4367, Comp. Stat. 1910, requiring that where the residence of a defendant to be served by publication is unknown, so that a copy of the publication cannot be mailed to him directed to his residence named therein, immediately after the first publication, the party who makes the service, his agent or attorney, shall before the hearing make and file an affidavit that the residence of the defendant is unknown, and cannot with reasonable diiigence be ascertained. The affidavit for publication which must precede the service by publication, and was filed in this case at the proper time, is. required to show that service of summons cannot be made within this state upon the defendant to be served, and that the case is one in which service by publication is authorized. (Id., Sec. 4368.) Such affidavit in this case stated among other things that the “present residence” of the déféncíant, George R. Brice, was unknown, and the notice was directed to the said defendant as one “whose present address is unknown.” But it does not appear that any affidavit was filed before the hearing or at any time, that the residence of the defendant cannot with reasonable.diligence be ascertained, as.required by Section 4367. The fact that no such affidavit had been filed might- have been known to the defendants at the time of the commencement of the hearing, and clearly *228was known to them when the plaintiffs had closed their evidence and the motion to dismiss was made. And an application could have been made when the fact first came to the knowledge of defendants to amend the answer so as to set up the defense.
We do not wish to be understood as conceding that the service upon Brice was insufficient. The trial court found that there had been due and sufficient service upon him by-publication, and his default was entered, on motion of counsel for plaintiffs, when the parties announced themselves ready for trial. We find it unnecessary to consider the question, having concluded that the objection on the ground of defect of parties was waived.
The judgment will be modified as directed in the' former opinion, and as so modified affirmed, and the cause will be remanded accordingly.
Beard, J., and Scott, J., concur.