This is a contest between certain mechanic’s lien holders and a purchaser under a mortgage foreclosure sale. The property consists of a certain lot in the City of Fargo, upon which a two-story brick building, with party walls on either side, has been erected. The mortgage was given long before the building or any part thereof was placed upon tlie lot. The mechanic’s liens attached before the foreclosure of the mortgage. This action was brought by the lienholders. The Red River National Bank was the only defendant that appeared and answered. It claimed title under the foreclosure proceedings, free and clear from all the mechanics’ liens. The trial court established the liens upon the building, and found the value of the lot without the building and the value of the building separately, and each at the same sum, and directed that the premises be sold, and that one-half of the proceeds of sale be paid over to the defendant bank; that the mechanics’ *143liens, as established, and in their order, be paid from the other half; and that the surplus, if any, be paid over to the bank. From this decree the bank appeals.
The first position of appellant, as we understand it, is briefly this: When the mortgage under which it derives title was given, and when it was foreclosed, and when appellant received its deed thereunder, the statute in force relative to mechanics’ liens declared that, where a building was erected upon land upon which there was an existing mortgage, the mortgage should remain a first lien upon the land, hut that the liens for labor and materials used in the construction of the building should be a first lien upon the building, and that the building might be sold under said liens, and removed from the land. Comp. Laws, § 5480. It concedes that it possesses only such rights as came to it through the mortgage, and that it took such rights subject to the mechanics’ liens, so far as they existed and could be enforced under the law existing when the mortgage was given, and when appellant acquired its title, but to no other or greater extent. It claims that the provision under which the court ordered a sale of the entire property was passed after it acquired its rights, and, in effect, impaired the obligations of the mortgage contract, and hence, as to appellant, such provision is unconstitutional and void. The provision is found in section 4795, Rev. Codes, which went into effect January 1, 1896, and is as follows: “But if in the opinion of the court it would be for the best interests of all the parties that the land and the improvements thereon should be sold together, it shall so' order and the court shall take an account and ascertain the separate values of the land and of the erection, buildings or other improvements, and distribute the proceeds of sale so as to secure to the prior mortgage or other lien, priority upon the land, and to the mechanic’s lien priority upon the building, erection or other improvement.” It will be noticed that under the prior law the priority of the mechanic’s lien was enforced by a sale and removal of the building. It so happens in this case that the building is so situated that it can be removed only by demolition. This a court will not sanction, where it would impair the rights of the former mortgagee. Lumber Co. v. Danner, 3 N. D. 475, 57 N. W. 343. Hence, if appellant’s contention that its contract rights are impaired be correct, it will follow that the mechanics’ liens can never be enforced against the property, and the appellant will enjoy the rare good fortune of having the value of its property doubled without any expense to itself.
It is admitted that the statute of which complaint is made is primarily remedial in character, but it is insisted that, if it enforce a remedy in a manner that prejudices contract rights, the facts that it is remedial does not take it out of the operation of the constitutional inhibition. It must be conceded that such is the law. Taylor v. Stearns, 18 Grat. 288; Bank v. Schranck, 97 Wis. 250, 73 N. W. Rep. 31, 39 L. R. A. 569; Barnitz v. Beverly, 16 Sup. Ct. 1042, 41 L. Ed. 93; Edwards v. Kearzey, 96 U. S. 600, 24 L. Ed. *144793; Antoni v. Greenhow, 107 U. S. 769, 2 Sup. Ct. 91, 27 L. Ed. 468. It is necessary, then, to determine whether this statute did prejudicially affect contract rights existing by virtue of the mortgage. The impairment prohibited by the constitution is not a mere imaginary or impossible injury. The law must render the contract obligation less valuable, either by a contraction of its scope or increasing its duties, or by rendering it invalid or less enforceable. If such be the necessary effect of the law, it matters not how slight the impairment. Green v. Biddle, 8 Wheat. 1, 5 L. Ed. 547. What were the rights of the mortgagee under the mortgage? Primarily, to have the property covered by the mortgage— which was the naked lot — applied to the satisfaction of the debt secured by the mortgage. True, as to the mortgagor, the rights under the mortgage have ripened into title, his right of redemption has been foreclosed. But as to these lienholders whose rights in the building under the former law were superior to the rights of the mortgagee, and which rights could not be affected by the foreclosure, the appellant must still rely solely upon its rights under the mortgage. Under the amended statute, and under the decree of the trial court, the lot is still devoted exclusively to the payment of the mortgage debt. The contract obligation is not impaired in that respect. But appellant says that, if a mechanic’s lien may be enforced by compelling a sale of the entire property, it might force a mortgagee to change the term of his investment, and put him to the trouble and expense of seeking another investment, and perhaps with a lower rate of interest. Should we admit this to be a valid objection to the statute, — and we do not, — still the answer would be that this appellant cannot raise that objection. Here, on the record, the mortgage was long since due. Appellant cannot possibly suffer in the manner indicated. “Only those whose rights would be prejudiced by the enforcement of an unconstitutional act can be heard to question its validity.” 6 Am. & Eng. Ene. L. 1090, and cases cited. Again, it is urged that the law forces the mortgagee’s security to a forced sale at the instance of the mechanic’s lien holder, possibly on a bad market, and compels him to take such proportionate share in the proceeds as will give him priority on the land. This is only an imaginary possibility. The statute does not necessitate a sale upon a bad market. The law cannot presume anything of the kind. Moreover, the objection ignores the express wording of the statute.. It says: “But if in the opinion of the court it would be for the best interests of all parties,” etc. The interests of the mortgagee are as carefully fostered as those of the mechanic’s lien holder. In this case we are bound to presume that the court found it to be for the best interest of appellant that the sale should be so ordered, and that is conclusively presumed to be correct, as it is not brought before us for review. We are clear that there is no impairment of contract here involved, of which appellant can complain.
Another position urged by appellant is that the statute, as found *145in the Revised Codes, is prospective only, and cannot be given a retrospective operation, and hence cannot apply to the liens here involved, or to rights accruing under the mortgage. The general rule requiring statutes to be given only a prospective operation unless a different legislative intent is manifest is well settled. But the rule is not generally applied to statutes relating to procedure. In Suth. St. Const. §.482, it is said: “Where a new statute deals with procedure only, prima facie it applies to all actions, — those which have accrued or are pending, and future actions. If, before final decision, a new law as to procedure is enacted and goes into effect, it must from that time govern and regulate the proceedings. But the steps already taken, the status of the case as to the court in which it was commenced, the pleadings put in, and all things done under the late law, will stand, unless an intention to the contrary is plainly manifested; and pending cases are not affected by general words as to future proceedings from the point reached when the new law intervened. A remedy may be provided for existing rights, and new remedies added to or substituted for those which exist. Every case must, to considerable extent, depend on its own circumstances. General words in remedial statutes may be applied to past transactions and pending cases, according to all indications of legislative intent; and this may be greatly influenced by considerations of convenience, reasonableness, and justice.” The numerous cases cited by the author ■ abundantly support the text. The new statute, in so far as it authorizes the court to order a sale of the entire property, and divide the proceeds in a manner to properly secure the rights of the respective parties, related to procedure only, and must be given a retrospective operation.
As its last contention, appellant urges that all the mechanics’ liens here asserted arose and were claimed under the lien law as it existed in the Compiled Laws, and that such law was expressly repealed by the Revised Codes, without any saving clause, and that consequently the liens given by that law perished with it. We do not think this result followed. We had occasion to discuss this point to some extent in Lumber Co. v. Lee, 7 N. D. 135, 73 N. W. Rep. 430. The authorities are not unanimous. We cited them to some extent on page 137, 7 N. D., and page 431, 73 N. W. Rep., but did not decide the point, as it was not necessary in that case. We were there discussing a purely statutory lien, — a lien on personal property for taxes, and in which no element of consideration or contract could enter. Where, under a contract such as the law prescribes, one party furnishes to another things of value, for which the law gives the party so furnishing a lien, such party, upon compliance with the statute, has a vested right in such lien. It is the security, the mortgage, which the law furnishes him, and upon which he relied in parting with his valuables. It is property in his hands, and cannot be devested by a repeal of the law under *146which he obtained it. In Weaver v. Sells, 10 Kan. 609, it is said: “When ever a mechanic’s lien is created for material furnished, the right to the lien becomes a vested right at the time the material is so furnished; and it is not within the power of the legislature to afterwards destroy such right by repealing the statute under which the right has accrued, or otherwise.” In Hoffman v. Walton, 36 Mo. 615, it is said: “The lien when filed, operates as an incumbrance.” In Wade, Retro. Laws, § 173, after stating the general principle that vested rights could not be destroyed by legislative action, the author adds: “The rights of contractors, material men, sub-contractors, and laborers, under statutes giving mechanic’s liens, and rendering them enforceable against the property upon which the work is done or materials furnished, are similar in kind, and governed by the same principles. The lien secured by giving notice, and otherwise complying with the law, or even the right to the lien before notice given, is part of the obligation of the contract, and at the same time is a right which the law secures to the mechanic or material man, under the same sanctions as may be invoked to protect the title to corporeal property.” In Waters v. Manufacturing Co. (Ga.) 32 S. E. Rep. 636, it is said: “When the lien of a material man has, under the terms of the statute, become fixed and secured, such lien is then a vested right, and no subsequent repeal or modification of the act under which it became fixed can destroy or modify such right.” See, also, Handel v. Elliott, 60 Tex. 145; Strenbel v. Railroad Co., 12 Wis. 67; Chowning v. Barnett, 30 Ark. 560; Hallaban v. Herbert, 11 Abb. Prac. (N. S.) 326; In re Hope Min. Co., 12 Fed. Cas. 487 (No. 6,681); Steamship Co. v. Joliffe, 2 Wall. 450, 17 L. Ed. 805; Skyrme v. Mining Co., 8 Nev. 219; Buser v. Shepard, 107 Ind. 417, 8 N. E. Rep. 280. We think the great weight of authority supports the holding of the foregoing cases. They certainly commend themselves to us as both logical and equitable. For a collection of the authorities holding that mechanics’ lien laws pertain only to the remedy, and that liens are changed or swept away with the law, see Boisot, Mech. Liens, § 33, and cases cited. Finding no error in the judgment roll, the decree of the District Court is in all things affirmed.
(81 N. W. Rep. 288.) All concur.