delivered the opinion of the court.
This is a petition for injunction to restrain the sheriff of *464St. Louis County from selling certain real property under a special execution. ' In June, 1873, William C. Jamison, 'trustee for Ellen Davis, a married woman, and Ellen Davis, to secure indebtedness, conveyed by deed of trust, which, was duly recorded, a lot of ground in the city of St. Louis, on which, at the time of the conveyance, were two three-story brick buildings. On January 29, 1876, Thomas, one of the defendants, being then trustee of the trust, sold the premises, under the terms- of the deed, to the plaintiff. On [February 10, 1875, Ketchum, one of the defendants, at the request of Ellen Davis, did work and furnished materials in painting the houses, and for this he filed a mechanic’s lien claim on June 16, 1875, upon which, in a suit against Ellen Davis and her trustee, he recovered judgment, it being purely a special judgment against the property, which is described as £ c a lot of ground, with two three-story brick buildings situated thereon,” etc. Upon this judgment execution issued, returnable to the April (1876) term of the court below, and it was to enjoin a sale by the sheriff under this execution that the present suit was brought, the plaintiff alleging that the sheriff was about to sell buildings as well as land, and not merely the interest of the execution -debtors. It was also alleged that the plaintiff was willing to do equity and pay the demand of Ketchum, if.the property were liable for it in plaintiff’s hands, but that, no person representing the deed of trust having been made a party to the lien suit, there had been no opportunity to defend, etc. The answer averred that plaintiff had notice of the lien of Ketchum, insisted that the lien attached to the buildings, and accepted the offer to pay which was con-' ditiorially made in the petition.
A preliminary injunction having been granted, a motion to dissolve .it was made and overruled, and by the same order the injunction was made perpetual. This injunction enjoined the defendants from selling the property, though an exception was made as to selling all the right, etc., of Ellen Davis, and restrained the defendant Ketchum from. *465■enforcing bis judgment “against the plaintiff’s land and the buildings already thereon, and fully completed and finished, when he contracted to repair the same.”
Upon the hearing, the -facts as stated above appeared, and it was admitted that before the plaintiff bought the property the lien claim was filed, and that plaintiff had notice of the lien ; that the work was a permanent improvement upon the realt}'', it being painting done upon the two houses. It also appeared from the record of the lien suit that the plaintiff in this suit filed a motion to set aside the judgment and to allow him to enter appearance and defend, as the petition said nothing as to the deed of trust, etc., and that the court overruled the motion so made. From the decree making the injunction perpetual the defendants appealed to this court.
It is first objected by the appellants that in this State an injunction will not lie to stay a sheriff’s sale under execution simply on the ground that the sale would pass no title, but throw a cloud on the title of the plaintiff. But the bearing of this rule upon the present case cannot be ascertained until the respective rights of the parties have been •considered. The appellants contend that under the mechanic’s lien law ICetchum had a lien for repairs and improvements upon the houses, notwithstanding the priority of the •date of the deed of trust, and the fact that that instrument was given after the houses had been completed. By the present law (Wag. Stat. 907), the lien is given to “every mechanic or other person who shall do or perform any work ■or labor upon, or furnish any materials ” * * * “for .any building, erection, or improvements upon land, or for repairing the same,” etc. The 2d section provides as to the manner and extent in which the land shall be subjected to the lien, and will be referred to hereafter. The ■3d section is as follows: “The lien for the things aforesaid, or work, shall attach to the buildings, erections, or improvements for which they were furnished, or the work *466was done, in preference to any prior lien, or encumbrance or mortgage, upon the land upon which said buildings, erections, improvements or machinery have been erected or put; and any person enforcing such lien may have such building, erection, or improvement sold under execution, and the purchaser thereof may remove the same within a reasonable time thereafter.” It is under this section that the appellants claim. But if the construction contended for by the appellants be put upon it, the law will then be retrospective in its operation, will impair the obligation of contracts, will divest settled rights of property. To test this, put a case where a mortgagee advances money to-build buildings, and on their completion takes his mortgage and duly records it. If, as against his vested rights in the buildings, a stranger to him, the mechanic, under a lien accruing long afterwards, may sell the buildings or take ,.them away, and thereby deprive the mortgagee of the security on which he may have chiefly relied, it would seem clear that the obligation of the mortgage contract is impaired, and settled rights of property divested.
The effect of the 3d section is, to a certain extent, to separate, in favor of the lien-holder, the buildings from the land; but the intention is not to do this as against persons who have previously parted with their money on the faith of a lien on the buildings as well as on the land. Not only has the Legislature no power to divest rights which have been vested under a previous contract, but it has: shown no disposition to do so. On the contrary, in the 2d section it uses prohibitory words, indicating an intention carefully to preserve the rights of third persons. If the-land is, as the 2d section declares, to be subject to the mechanic’s lien “to the extent, and only to the extent, of all the right, title, and interest owned therein by the owner or proprietor of such building, erection, or improvement for whose immediate use or benefit the labor was done or materials were furnished,” it is difficult to see how the inten*467tion and principle thus strongly expressed can be set at naugbt in construing the next section. The 2d section relates to the land; the 3d section relates to the buildings. It cannot be the intention of the Legislature to carefully regard the interests of third parties as existing in the land, and to totally disregard the interests of third parties as existing in the buildings at the inception of the mechanic’s lien. If the building is completed before a mortgage is given, the mortgagee has as much right to rely on the building as on the land. Any separation of buildings and land must, at this stage, be at the expense of the mortgagee, who has bought and paid for his prior lien. But where the mechanic builds a new building, here is property on which the prior mortgagee did not rely, and so, in favor of the mechanic, the statute does away with the rule that makes the building follow the land, and, quoad hoc, separates the two. It is true, the mechanic may have put repairs npon the building, subsequently, which have greatly enhanced its value ; and if some method had been provided by which — as, for instance, under the act in relation to liens upon boats and vessels — the property could be sold, there might be an equitable adjustment as between the mortgagee of a building and the holder of a mechanic’s lien for subsequent repairs upon that building. But the courts cannot add sections to the statute, or provide machinery by which completed buildings can be separated from their subsequent additions. They can only carry out the statute as far as it goes The rule as to buildings once completed, and labor and materials furnished for their original completion, the statute provides. For such labor and materials a mechanic’s lien is given, which attaches to the buildings thus created in preference to the lien of the mortgagee of the land. But a mortgagee who has paid his money for a lien on buildings cannot be required to abandon his lien as against the lien claim of a mechanic who subsequently puts repairs on the buildings, because no means are afforded for separating the two interests in the building, and because, as between the *468mortgagee and the lien-holder, the rights of the former were vested before those of the latter came into being. In case of the mechanic who merely makes subsequent repairs, it would require a fiction to carry the lien back. Its inception can ojnly date from the time when the repairs are made. But, in case of the mechanic who contributes to the original completion of the improvement, the lien arises contemporaneous!y with the property on which it rests.
The view here taken is not in any way opposed to that of the Supreme Court in the case of Smith v. Phelps, 63 Mo. 585, which case the appellants rely on. The Kileg lien, under which title the plaintiff recovered in that case, originated in 1867, or before, while it was not until May or April, 1870, that Allen, the mechanic, made his contract and began to put up the hotel building (Allen v. Sales, 56 Mo. 32); so that, as against the building, the representative of the Kileg title had no claim. That was a case of leased ground, and the remarks of Judge Napton, who delivered the opinion, refer to the right of the mechanic in the house which he builds, and have no application to subsequent repairs.
In the case of Getchell v. Allen, 34 Iowa, 559, under a section similar to the 3d section above quoted, it was held that the word “improvement,” as there used, means, not an addition to the building, but an independent structure on the land; that where, as against a mortgagee holding a mortgage on a lot and a building thereon, a lien was claimed for lumber furnished under contract with the •owner, partly for putting a third story on the house already built, partly for erecting a stable, the part of the claim for materials used in erecting the new structure had preference -to the lien of the mortgage, while that part which was for ¡subsequent repairs ujion the house covered by the mortgage must give place to the latter. In Taylor v. Railway Co., 4 Cent. L. J. 536, where the same provisions of the Iowa statute are construed, substantially the same construction is put upon them. Speaking of a mechanic’s *469lien, under the section to which we have referred, as almost identical with the 3d section of our act, Judge Dillon says: “But when does this lien attach as against a prior mortgagee of land and building? The answer is, at the same time it attaches against the owner. The result is that repairs on a previously completed building, or railway, on which a mortgage rested prior to the commencement of such repairs, do not give a lien which will override the lien of the mortgage.”
It thus appearing that the lien under which the plaintiff claims was superior to that of Ketchum, and that a sale under the judgment of the latter could have conveyed no title as against the plaintiff, the question recurs whether the injunction was properly granted. Though there are cases in which the distinction is not borne in mind, yet it seems clear that where the cloud to be cast upon the title exists only upon the supposition of an incorrect legal view being taken of facts which are patent to all, there equity will not enjoin the sale. “ That can never be considered a legal cloud,” says Chancellor Walworth, “ which cannot for a moment obstruct the unaided rays of legal science when they are brought to bear upon the supposed obscurity.” Van Doren v. Mayor, etc., 9 Paige, 388; Pixley v. Huggins, 15 Cal. 127. Where, through fraud, or other cause, the introduction of evidence in pais is requisite to furnish the basis necessary for a correct legal judgment, a different state of facts is presented. In the case at bar, however, there is no such obscurity. The record of the lien suit, as well as the registry, shows the existence of the deed of trust, and the record of the lien suit shows that no persons representing the deed of trust were made parties to that suit. Thus the legal mind brought to bear upon facts, all of which are matters of record, could at once have ascertained, in spite of the form of the judgment, that no title would have passed by the sheriff’s sale as against the holders of the deed of trust. This being so, under the authorities just cited, the bill cannot be maintained. But *470the Supreme Court of this State has not been willing to go so far in allowing an injunction as the authorities just cited. It has held that under our statutory provisions it would be unwise, and create confusion, to permit sales under execution to be enjoined on the ground that they will pass no title and might cast a cloud on the title of the true owner; and the effect of these decisions is to impose additional restrictions upon the exercise of the enjoining power in such cases. Drake v. Jones, 27 Mo. 428; Kuhn v. McNeil, 47 Mo. 389. Accordingly, the motion to dissolve the injunction should have been sustained and the bill dismissed.
The decree of the court below is reversed and the case remanded, with directions to dismiss the suit.
All the judges concur.Note. — In an opinion on motion for rehearing, the cases 57 Mo. 519, 54 Mo. 577, 52 Mo. 272, 51 Mo. 535, and 51 Mo. 60, were reviewed, and the conclusion reached that the rule which forbids an injunction in cases like the present, adopted as early as 12 Mo. 617, has never been departed from in this State.