
    SOLIRI, Respondent, v. FASSO et al., Defendants; BERTOGLIO, Appellant.
    (No. 4,036.)
    (Submitted September 19, 1919.
    Decided November 5, 1919.)
    [185 Pac. 322.]
    
      Mechanics’ Liens — Foreclosure—Parties—Improvements—Constructive Notice• — -Equity—Sale of Property — Distribution of Proceeds — Estoppel—Waiver—Default Judgment — Clerk of District Court — Dismissal of Actions.
    
    Default Judgment — Entry by. Clerk — Ministerial Act.
    1. The clerk of the district court, in entering judgment by default, as provided in section 6719, subdivision 1, Revised Codes, acts ministerially, not judicially.
    Same — When Judgment a Nullity.
    2. Whether the aetion in tvhieh, upon application of plaintiff, the clerk of the district court is required to enter judgment upon default of defendant, is one upon contract for the recovery of money or damages only, the clerk must determine from the allegations of the complaint alone, and if it is not such, the judgment he may enter is a nullity and may be set aside.
    Same — Mechanic’s Lien — Foreclosure.
    3. An aetion for the foreclosure of a mechanic’s- lien is not one on contract for the recovery of money or damages only; hence the clerk of the district court ig without jurisdiction to enter a judgment by default in such an action.
    Void Judgment — Duty of Court to Cancel Entry.
    4. When a void judgment is called to the attention of the court in which it was entered, it must purge its records of the nullity by canceling the entry.
    Mechanic’s Lien — Void Default Judgment — Waiver—Estoppel.
    5. A vdid judgment by default in an aetion to foreclose a mechanic’s lien which made no reference to the lien referred to in the complaint did not constitute a waiver or estoppel against plaintiff of his cause of action.
    Dismissal of Action — Neglect to Enter Judgment — Rule.
    6. To warrant dismissal of an aetion after verdict or final dismissal, under section 6715, Revised Codes, if demand for entry of judgment be not made for more than six months, failure of the party entitled to judgment to demand its entry must have been due to negligence on his part.
    Mechanic’s Lien — Proper and Necessary Parties.
    7. In an action for the foreclosure of a mechanic’s lien all persons holding interests or liens subsequent to the inception of plaintiff’s rights are proper and necessary parties defendant.
    [As to necessary or proper parties to aetion to foreclose mechanic’s lien, see note in Ann. Cas. 1918B, 3.]i
    Dismissal of Action — Negleet to Enter Default Judgment.
    8. Held, under the above rule (par. 6), that failure of plaintiff ip. an action to foreclose a mechanic’s lien to proceed to valid judgment within six months after default of one of several defendants did not, in view of the circumstances presented^ constitute neglect on his part so as to compel dismissal of the aetion, nor bar further proceedings as to the other defendants.
    Mechanic’s Lien — Improvements—Constructive Notice.
    9. One who acquires an interest in property during the time improvements are being placed thereon will be held to have had constructive notice that work had been and was being done thereon.
    Same — Extent of Lien — Case at Bar.
    1(>. P. purchased a lot from D. on installments; after repair work on a building situated on the lot had started, B. advanced $220 to P. with which to pay the last installment due to D. D. thereupon gave deed to B., P. being also indebted to B. in an additional amount of $600. B. then conveyed to P., the amount to be paid by the latter, being the aggregate of the sum advanced to D. and the amount of $600 owing by P. Held, in an aetion to foreclose a mechanic’s lien for work done on the building, that it was at least the interest P. had at the time the work was commenced, which was bound by the lien, not a less interest caused by the transactions to whieh the lien claimant was not a party.
    Same — Equitable -Powers of Court — Sale of Property — Distribution of Proceeds.
    11. In an action seeking the foreclosure of a mechanic’s lien, the court under its equity powers may deeree whatever is necessary to protect the rights of all persons interested; and where an adjustment of the equities is difficult and a partition may not be effected without injury, a sale of the entire property may be had and the proceeds of sale applied to the benefit of the respective claimants in the order of their priority.
    
      
      Appeal from District Court, Silver Bow County; J. J. Lynch, Judge.
    
    Action by Victor Soliri against Margaret Fasso and others. From the judgment and an order denying his motion for a new trial, defendant Dominick Bertoglio appeals.
    Reversed and remanded.
    
      Mr. Eéwin M. Lamb, for Appellant, 'submitted a brief; Mr. Frank C. Walker, of Counsel, argued the cause orally.
    We contend that under the facts disclosed in this case, plaintiff should be denied the right to enforce a lien upon any of the property for the following reasons: That Mrs. Margaret Fasso was never the owner of the property in controversy; that the work and material did not enter into the construction of an original building; that there is no proof that the work and material enhanced the value of the property; that it is apparent and clear that the improvement, if any, made by plaintiff could not be removed without despoiling a part of defendant Bertoglio’s estate; and that the defendant, Bertoglio, did not consent to the work and material being performed and furnished and had no knowledge of it.
    This court in discussing the various provisions relative to liens makes it very plain that it is thé interest only of a judgment debtor that can be charged. (Missoula Mercantile Co. v. O’Donnell, 24 Mont. 65, 60 Pac. 594, 991.) If it should be held that Mrs. Fasso had some interest in this property, then under the principles of law laid down by our court, if this was the original building, the plaintiff would have a right to enforce -his lien as against the building (Stritzel-Spaberg< Lb'r. Co. v. Edwards, 50 Mont. 49, 144 Pac. 772) ; but it is undisputed that the work and materials were for the mere repair and improvement of a building which is situated upon the real property in controversy, and thus a part of the realty itself, legal title of which was never in Mrs. Margaret Fasso. (Ford v. Dixon, 171 Mo. App. 275, 157 S. W. 99.)
    
      
      Mr. Jas. T. Shea, for Respondent Soliri, submitted a brief; Mr. Frank Woody, of Counsel, argued the cause orally.
    We contend that under the facts disclosed in this case, respondent should be given the right to foreclose his lien against the property involved, for the following reasons: That at all times herein mentioned, Margaret Fasso was the owner of the premises; that she failed to defend the suit of foreclosure; that appellant Bertoglio is only a mortgagee of the property herein in controversy; and that appellant’s mortgage was taken subject, subsequent and subordinate to the lien of plaintiff.
    As between a mortgage of real property and other liens or claims which may attach as liens on the premises, the general rule is that that which is first in time is first in right. ("Valley Lumber Co. v. Wright, 2 Cal. App. 288, 84 Pac. 58; Marquam v. Boss, Ml Or. 374, 78 Pac. 698, 83 Pac. 852, 86 Pac. 1; Bay v. Hollenbeck, 42 Fed. 381; First Nat. Bank of Salem v. Salem Capital Flour Mills Co., 39 Fed. 89; 27 Cyc. 1171, 1172.)
    Where there is no valid contract between the owner and contractor, the priority of mechanics’ liens is to be determined by the time the work was done, or the materials commenced to be furnished. The time when a materialman commenced delivery fixes his rights as a lien claimant, as between him and a mortgagee as well as other lien claimants. {Burnett v. Glas, 154 Cal. 249, 97 Pae. 423.)
    If a mortgage for purchase money be not simultaneous with the conveyance, but subsequent, and before it is executed and recorded the purchaser enters into a contract for the erection of a building upon the land, the mechanic’s lien is superior to the lien of the mortgage. (2 Jones on Liens, sec. 1458.) The lien has priority over a mortgage recorded after the making of the contract under which the lien is claimed. {Id., see. 1465; see, also, secs. 1480, 1487, 1617b.)
   MR. JUSTICE’ HURLY

delivered the opinion of the court.

Plaintiff brought action for the recovery of a balance due from Margaret Fasso, one of the defendants, by reason of his performance of a contract for the repair and construction of a dwelling-house, and for the foreclosure of a mechanic’s lien alleged to have been duly perfected, affecting such building and the lot on which the same is situated.

The complaint alleges “that the legal title to the property is in the name of defendant Bertoglio under and by virtue of a warranty deed executed on the twenty-first day of February, 1914; which warranty deed, though absolute on its face, was and is intended as a mortgage on the property, and that said mortgage was executed several months after the work was commenced and the materials furnished, ’ ’ etc., and prays that the adverse claims of the defendant be adjudged subordinate to plaintiff’s lien.

The answer of the defendant Bertoglio admits that the legal title to the property is in his name, alleges ownership since the twenty-first day of Fébruary, 1914, and denies all other allegations of the complaint.

It appears that, after the commencement of the action, process was duly served upon each defendant, and that the defendant Fasso failed to appear. On the 30th of April, 1915, prior to the filing of answers but after appearance by. the other defendants, plaintiff’s attorney caused the default of the defendant Fasso to be entered and on the same day at' his instance the clerk entered and docketed a money judgment against said defendant for the sum of $1,350 and costs, which judgment makes no reference to the lien referred to in the complaint.

The cause came on for trial on the eighteenth day of January, 1916, and before the introduction of any evidence the plaintiff moved' the court to set aside the judgment, on the ground that it had been inadvertently entered. The court, over appellant’s objection, granted the motion, basing the ruling upon the grounds that, the action being for the foreclosure of a lien, the clerk was without authority to enter the judgment; that it was a mere nullity and could be stricken from the records at any time on motion of the plaintiff or the defendant or of the court’s own volition. The court then permitted plaintiff to proceed with proof as to the cause of action, over defendants’ objection that the court was without jurisdiction of the subject matter, in that more than six months had elapsed since the entry of the default and judgment, and that, the cause of action having been merged in a judgment against defendant Fasso only, plaintiff was thereby estopped from proceeding further against the remaining defendants.

The defendant Fasso, before the date of any of the matters herein referred to, had entered into a contract with one Mrs. Dreeland for the purchase of the lot upon which the building is situated, and had not fully completed her payments therefor at the time the plaintiff commenced his work upon the building. After the work was started, defendant Bertoglio advanced either $200 or $225 with which to pay Mrs. Dreeland the balance due her. Whether this money was given to Mrs. Fasso for the purpose of paying Mrs. Dreeland, or paid directly to Mrs. Dreeland by Bertoglio, is not clear. Mrs. Dreeland then gave to Bertoglio a deed for the premises. At that time Mrs. Fasso was also indebted to Bertoglio upon a pre-existing indebtedness amounting to some $600 or $700. Some weeks or months after the taking of the deed by Bertoglio, he and Mrs. Fasso entered into an agreement for the conveyance of the property by him to her for the sum of $879.35, to be paid in monthly installments; the amount to be paid by Mrs. Fasso apparently being the aggregate of the sum advanced to Mrs. Dreeland and the other indebtedness owing by Mrs. Fasso to him. Mrs. Fasso testified that the purpose of these transactions was to furnish security to Bertoglio upon the premises for the entire indebtedness, though the contract is in the ordinary form of one for the sale and purchase of real property and makes no reference to its being given for security. Bertoglio was not sworn as a witness upon the trial.

The trial court found that the transactions in effect constituted a mortgage in favor of Bertoglio against the property, and that, it having been entered into after the commencement of work and the furnishing of materials by the lien claimants, the liens were superior in right to the interests of Bertoglio, and also determined that the lien of the Western Lumber Company was superior to the lien of plaintiff. The appellant has argued in his brief only the points hereafter discussed.

It is contended that there is no evidence showing any title in the defendant Fasso, and that, the work and materials having been furnished for repairing and building an addition to a structure already upon the premises, the claim of the plaintiff, even if not waived or extinguished by the entry of a personal judgment, does not constitute any charge whatsoever against the property.

Section 6719, subdivision 1, of the Revised Codes, provides: “In an action arising upon contract for the recovery of money or damages only, if no answer, demurrer, * * * has been filed with the clerk, * * * the clerk, upon application of the plaintiff, must enter the default of the defendant, and immediately thereafter enter judgment for the amount specified in the complaint,” etc. An examination of this statute leads to the conclusion that the clerk, in entering judgment thereunder, acts ministerially and not judicially, and must determine from the allegations of the complaint alone whether the action is one upon contract for the recovery of money or damages only, and, if not, then he has no authority to enter a judgment therein, and if he mistakes, the judgment is a nullity. (McDonald v. City of Placerville, 6 Cal. Unrep. 192, 55 Pac. 600; Crossman v. Vivienda W. Co., 136 Cal. 571, 69 Pac. 220; Shay v. Chicago C. Co., 111 Cal. 549, 44 Pac. 237, and eases there cited.)

An action for the foreclosure of a lien is not an action on contract for the recovery of money or damages only. Conceding that under the authority of Missoula Mercantile Co. v. O’Donnell, 24 Mont. 65, 60 Pac. 594, 991, and other decisions of this court, a lien claimant may waive his lien and take judgment in the proper cases for money only, the entry of judgment by the clerk alone, without an order of the court, might in effect amount to a dismissal of the action as to the remaining defendapts, without any direction from plaintiff, or might at least constitute a bar to further proceedings therein. The rendition of a proper judgment under these circumstances required, not the performance of a mere ministerial function, but judicial action. However, the language of the statute is clear, and, in actions where something other than the relief provided for therein is demanded the clerk is without jurisdiction to enter judgment. (State ex rel. Reser v. District Court, 53 Mont. 235, 163 Pac. 1149.)

The judgment entered, being beyond the clerk’s jurisdiction, was a mere nullity and may be set aside. (State ex rel. Smith v. District Court, 55 Mont. 602, 179 Pac. 831.) “When a void judgment is called to the attention of a court in which it was entered, it is incumbent upon that tribunal to purge its records of the nullity by canceling the entry.” (Hodgdon v. Goodspeed, 60 Or. 1, 118 Pac. 167.) Being- void, it would not constitute a waiver or estoppel against the plaintiff of his cause of action upon the lien. (Finlen v. Heinze, 27 Mont. 107, 69 Pac. 829.)

Our statute (see. 6714, Rev. Codes) provides that an action may be dismissed “by the court, when after verdict or final submission, - the party entitled to judgment neglects to demand and have the same entered for more than sis months.” (See Rule v. Butori, 49 Mont. 342, 141 Pac. 672; State ex rel. Stiefel v. District Court, 37 Mont. 298, 96 Pac. 337; Franzman v. Davies, 32 Mont. 251, 80 Pac. 251; Pullen v. City of Butte, 45 Mont. 46, 121 Pac. 878; State ex rel. Kohl v. District Court, 46 Mont. 348, 128 Pac. 582; Joyce v. McDonald, 51 Mont. 163, 149 Pac. 953.)

It was said in Rule v. Butori, supra, that, at the time the opinion was rendered therein, the only prior decision of this court, which could be claimed as lending any support' to the theory that the mere failure of a defendant to enter judgment within| the sis months’ period would constitute a bar to proceeding further therein, was that of State ex rel. Stiefel v. District Court, supra. After quoting from the opinion in the last-mentioned case, Mr. Justice Sanner, speaking for the court, said: “This language is to be considered in connection with the circumstances under which it was uttered, vis., an intentional omission to have the judgment entered. We repeat now that, in the provision referred to, ‘may’ means ‘must’; and, when a case presented is within this provision, the court has no power to relieve from it, or to say that it shall not be applied. But the fact that a statute is mandatory does not deprive the courts of all judicial faculty to .determine whether the case presented is within such statute. Discretion in that sense always exists. What, then, are the circumstances under which the action must be dismissed by the court? They are, not when the party entitled to judgment fails to demand and have it entered within six months after submission or verdict, but when he neglects so to do. The choice of the verb ‘neglects’ cannot be regarded as accidental, for it is not the policy of our law that a party shall suffer who is without fault, and the provision appears to have been taken from California, where, prior to its adoption in this state, a fixed construction had been placed upon it with reference to this very word. In Gardner v. Tatum, 77 Cal. 458, 19 Pac. 879, decided in 1888, the court said: ‘We nevertheless think that the refusal to dismiss the action was proper under the circumstances. The rule established by the statute applies to cases where the party has been guilty of negligence. * * # If the plaintiff was guilty of any negligence, * * * it was of such a slight character as not to bring him within the scope of the provision.’ ” (Rule v. Butori, supra.)

It is self-evident that in'an action for the foreclosure of a mechanic’s lien all persons holding interests or liens subsequent to the inception of the plaintiff’s rights are proper and necessary parties defendant if the plaintiff is to pursue his lien claim to final adjudication, and that the interests of all such persons must be determined therein, else such persons are not bound nor their rights affected thereby. Plaintiff’s right to a lien was being controverted by the defendants Bertoglio and Western Lumber Company, and it appears that at the time of filing their answers no question was raised by them as to the entry of judgment against Fasso, though the judgment was then a matter of public record; also, that following the service and filing of said answers the plaintiff replied thereto, and that issue was joined between the answering defendants and the plaintiff; and, from all that appears, the case came on for trial as early as could be expected after issue was joined.

In State ex rel. Stiefel v. District Court, supra, the facts found constituted “neglect” on the part of the plaintiff, and consequently, under the terms of the statute, the plaintiff was held barred from further proceeding therewith. The holding was based on the theory that under the conditions stated there had been a “final submission” as to the defendant Stiefel by the entry of his default, because there could have been entered a judgment effectually determining the questions involved between him and the plaintiff, without regard to the other defendants.

In Joyce v. McDonald, supra, the court held that the failure to have judgment entered, under the circumstances there” referred to, even though several years had elapsed after final submission, did not bar the right to enter the judgment.

Here, had the plaintiff made valid application to the court for a judgment against Mrs. Fasso, the court could only have determined the questions involved as between her and the plaintiff, leaving undetermined the respective claims of the remaining defendants. Then, upon a trial as between plaintiff and the remaining defendants, unless the plaintiff had waived his lien by the course pursued, the court would have been compelled to render a second judgment, perhaps limiting or modifying the previous one. Certainly, the law does not contemplate trying lawsuits piecemeal, nor does it ‘ require the doing of useless things. We feel that the failure of the plaintiff to proceed to a valid judgment as to the defendant in default, in view of the facts and circumstances shown, did not constitute neglect on his part, nor a bar to further proceeding with the cause as to all the defendants.

■ No matter what the form of the transaction, between Fasso, Bertoglio and Dreeland may have been, Mrs. Fasso still retains an equitable interest in the property. The testimony shows that she continued her residence thereon, and was so residing at the time of trial, and no evidence was tendered showing a cancellation of her rights under the contract. Bertoglio acquired his interest during the period of construction, and must be charged with at least constructive notice that work had been done and was being done.

■ After Bertoglio made the advance of money for Mrs. Dreeland, the contract made between him and Mrs. Fasso in effect enhanced the purchase price to be paid by Mrs. Fasso for the lot, and which, if appellant’s position is correct, would likewise charge the property with a larger indebtedness than the original contract price, to the prejudice of the lien claimants to the amount of the antecedent debt owing by Mrs. Fasso to Bertoglio. It is at least the interest which Mrs. Fasso had at the time of the commencement of the work which is bound by the lien, not a less interest caused by collateral transactions to which the lien claimants are not parties.

In Hickox v. Greenwood, 94 Ill. 266, a situation somewhat similar to the one under consideration here was involved. Hickox, the owner of a lot, entered into a contract with one Peat for the sale of the same for the sum of $200. Peat thereafter caused a house to be built upon the premises. After the work was started by the contractor, Peat found that he was in need of additional funds and borrowed an additional $230 from Hickox. The original agreement was then abrogated and a new contract entered into in the ordinary form, for the sale by Hickox to Peat of the lot for a stated consideration of $430. A suit was afterward brought which involved the priority between a mechanic’s lien filed by the contractor and the rights of Hickox under his agreements with Peat. The supreme court said: “As to the $230, which was lent to Peat by Hickox after the making of the building contract, Hickox occupies in equity the position of the holder of an encumbrance subsequent to the building contract and subordinate to the mechanic’s lien. This is an encumbrance, not upon the fee, but upon- Peat’s interest in the lot.”

Whether the situation creates a resulting trust, or a mere mortgage, or a sale, we deem not of serious consequence. Mrs. Fasso having an equitable interest in the property, the lien attached to such equity whatever it may have been. While defendant Bertoglio is not seeking to establish a claim for a money judgment, this being an action involving the adjustment of equitable rights, we believe it is within the province of the court to adjust and determine those rights. -“While the right to a.lien is purely statutory, and compliance with the statute is necessary to the existence of a lien, * * * the necessary steps once having been taken, the lien law is subject to the most liberal construction; for it is remedial in character, and rests upon the broad principle of natural equity and commercial necessity.” (Stritzel etc. L. Co. v. Edwards, 50 Mont. 49, 144 Pac. 722.) “While the mechanic’s lien law is statutory, it is also equitable in its nature, and rights under it or associated with them must yield to the power of a court of equity to decree that which is necessary to protect the rights of all interested.” (Phillips on Mechanics’ Liens, sec. 257.)

The authorities are not in harmony, but in some instances it is held that where an adjustment of the equities is difficult, and where a partition may not be effected without injury, a sale of the entire property may be had and the proceeds of sale applied to the benefit of the respective claimants in the order of their priority. (27 Cyc. 445; Ruggles v. Blank, 15 Ill. App. (Bradw.) 436.)

While it is true that the sum advanced to Mrs. Dreeland creates an interest in favor of Bertoglio, superior to the lien claims both as to the lot and building (sec. 5721, Rev. Codes; Johnson v. Puritan M. C. Co., 19 Mont. 30, 47 Pac. 337, and cases there cited), nevertheless the actual value of the property and the improvements is greatly in excess of this nominal interest. In view of the peculiar circumstances involved and based upon the record in this particular instance, we believe that a preservation of the equities may be best obtained by a sale of the entire property; the proceeds to be applied as hereinafter indicated.

We are unable to determine from the record whether any of the sums due Bertoglio have been repaid, and, before a proper disposition of all the equities can be had, these facts must be determined by the trial court. In our opinion, after this determination, if neither of the lien claimants pay to Bertoglio, within such reasonable time as may be fixed by the court, the amount advanced by him to Mrs. Dreeland with interest thereon, then the property should be sold and the proceeds applied, first, to the payment of costs, then to the amount paid by Bertoglio to Mrs. Dreeland, with interest, then to the payment of the respective mechanics’ lien claimants in the order of their priority, if either has any greater legal right than the other, and, if any surplus remains, the balance to Bertoglio upon the amount of the additional indebtedness held by him against Mrs. Fasso secured by the contract in question, and the remainder to Mrs. Fasso. If either lien claimant before judgment or sale pays Bertoglio the amount remaining due him by reason of the advancement to Mrs. Dreeland, we think section 5724 of the Revised Codes furnishes ample protection, and such sum should be repaid such claimant before any of the' proceeds of the sale are applied upon the lien claims.

The judgment and order appealed from are reversed and the cause is remanded for a new trial.

Reversed and remanded.

Mr. Chief Justice Brantly and Associate Justices Holloway, Patten and Cooper concur.  