
    [File No. 6792]
    THE DUNHAM LUMBER COMPANY, a Corporation, Respondent, v. ANTON GRESZ et al. THE STATE OF NORTH DAKOTA, Doing Business as State Land Department, Appellant.
    (2 NW (2d) 175)
    
      Opinion filed January 26, 1942.
    Rehearing denied February 16, 1942
    
      Alvin O. Strutz, Attorney General, and G. E. Brace, Assistant Attorney General, for appellant.
    
      Hyland & Foster, for respondent.
   Morris, J.

This suit presents a question of priority between the plaintiff’s mechanic’s lien for building material and a real estate mortgage belonging to the state of North Dakota. The property involved is a dwelling house.

On or about the 23d day of May, 192’T, the state of North Dakota made a real estate loan to one Anton Gresz out of permanent school funds of the state. The loan was made through the State Land Department. The mortgage securing the loan covered a half section of land in Billings county.

The state legislature by chapter 155, ND Session Laws 1929, amended the Mechanics’ Lien Law to provide that “when material is furnished or labor performed in the erection or construction of an original, complete and independent building, erection or improvement, whether the same has been placed upon a foundation or not, the lien provided for by this chapter shall attach to such building, erection or improvement in preference to any prior title, claim, lien, encumbrance or mortgage upon tbe land upon wbicb sucb building, erection or improvement is erected, and upon foreclosure of such lien, sucb building, erection or improvement may be sold separately from tbe land, and may be removed from tbe land within the time herein specified; and in tbe event of such sale of said building separate from the land and the removal of said building therefrom the same shall be and operate as a full satisfaction and discharge of the lien upon such real estate. It is further provided that at the time the material is furnished, -the seller thereof shall notify the purchaser by delivering to him a written notice advising tbe purchaser that the seller has tbe right under tbe lien laws of the State of North Dakota, in tbe event that there is a default in tbe payment thereof, to remove, by means of a foreclosure of said lien, said building from tbe real estate upon wbicb it is placed, regardless of whether or not said building is placed upon a foundation.”

This amendment became effective July 1, 1929. Between July 21, 1930, and December 18, 1930, tbe owners of tbe real estate purchased building material from tbe plaintiff and therewith erected a dwelling-house on tbe premises covered by the state’s mortgage. On July 22, 1930, tbe plaintiff gave tbe. statutory notice of its right to file a mechanic’s lien and its right to foreclose the same on and remove the building as prescribed by the aforesaid statute. On January 31, 1931, plaintiff filed its lien and now brings this action to foreclose it. It asks that the court direct the dwelling house to be sold separate from the land and removed therefrom.

On July 15, 1938, Anton Gresz, then a widower, delivered a quitclaim deed to the premises covered by the state’s mortgage. The deed was accepted in accordance with tbe provisions of chapter 254, ND Session Laws 1935, which permits tbe state to receive conveyances of premises mortgaged to it without extinguishing its mortgage lien thereon. Tbe state contends that its mortgage contract, by virtue of tbe law in force at the time it was made, gave to tbe state a lien upon the premises therein described and upon all buildings and improvements that might be subsequently placed thereon during the'lifé of tbe mortgage. It contends that its mortgage attached to the house as it was being erected and was at all times prior and superior to any lien that the plaintiff may have acquired under the provisions of chapter 155, ND Session Laws 1929.

There is no question but what, as the state contends, the law of the land in existence at the time a contract is entered into forms a part of that contract the same as if the provisions of the law were expressly incorporated therein. It is also true that the obligations of a contract are determined by the law in force at the time it is made. State ex rel. Cleveringa v. Klein, 63 ND 514, 249 NW 118, 86 ALR 1523.

It may also be stated to be a general rule that a mortgage upon real estate not only covers buildings and improvements on the land at the time the mortgage was given but also attaches to all buildings and improvements subsequently annexed to the real estate during the life of the mortgage. Woolridge v. Torgrimson, 59 ND 307, 229 NW 805; Kentucky Lumber & Mill Work Co. v. Kentucky Title Sav. Bank & T. Co. 184 Ky 244, 211 SW 765, 5 ALR 391; Holloway v. Hendrick, 98 NJ Eq 713, 129 A 702; Basham v. Goodholm & S. Invest. Co. 52 Okla 536, 152 P 416; Cutler v. Keller, 88 Wash 334, 153 P 15, LRA 1917C 1116.

The state premises its argument upon the foregoing legal principles, and asserts that by virtue of the law as of the time when the mortgage was executed it became entitled by contract to a mortgage lien, not only upon the land and improvements thereon as of that time, but that it also had the right to a first lien upon any buildings or improvements subsequently built upon or affixed to the land covered by its mortgage. It claims, as a contractual and vested right the right to a lien upon subsequént annexations to the mortgaged property, and asserts that in so far as chapter 155, ND Session Laws 1929, permits a lien prior to that of the plaintiff to attach to such subsequent annexations it impairs the obligations of the state’s contract and is to that extent unconstitutional.

The plaintiff argues that at the time chapter 155 became effective, the building in question had not been erected and was therefore not covered by plaintiff’s mortgage and that the legislature might by statute change the law and give the plaintiff a mechanic’s lien upon buildings to be erected upon mortgaged lands in the future without impairing either contractual or vested rights of a mortgage.

A lien of a mechanic or a materialman is purely statutory. Its existence and extent are defined and limited by legislative enactments. Chapter 155 amends § 6823, ND Comp. Laws 1913. The law, at the time the mortgage was executed, provided for a mechanic’s lien but did not make such a lien superior to that of an existing mortgage on the real estate, nor did it permit the removal of the building as against the rights of an existing mortgagee on the real estate.

The legislature has seen fit to consider the question of priority between mechanics’ liens and mortgage liens on a number of occasions. Section 666, Code of Civil Procedure, 1877, gave mechanics’ liens preference to mortgages on the land in so far as such liens affected buildings and improvements and permitted the sale and removal of buildings when subject to mechanics’ liens. This general provision with some alterations was kept in our statutes until 1905 when it was repealed by chapter 130 of the Session Laws of that year. From then until the enactment of chapter 155, ND Session Laws 1929, the law did not provide for separate and prior mechanics’ liens on buildings as against mortgage liens on the real estate at the time the buildings were erected.

When the state took its mortgage on the premises described therein the mortgage lien covered those premises as they then existed including all the buildings and annexations thereto. That security could not be impaired by any legislative act. The amendment to the Mechanics’ Lien Law does not purport to affect in any way the actual security upon which the state took its lien. It does not apply to liens for improvements or repairs upon existing buildings. It gives the mechanic or materialman a lien upon “an original, complete and independent building, erection or improvement, whether the same has been placed upon a foundation or not” in preference to an existing mortgage upon the land on which the building is erected.

While at the time the mortgage was executed, the law was such that the mortgage would attach to subsequent annexations to the real estate, it was also the law that “Parties are at liberty to make any agreement or arrangement with regard to their property that they see fit, and to give to fixtures the legal character of realty or personalty at their option; and, if the agreement is such a one as will malee the property personal property, as between the parties, it is personal property, and may be so treated.” Mathews v. Hanson, 19 N.D 692, 124 NW 1116.

The purpose of the amendment to the Mechanics’ Lien Law was to intervene in favor of the mechanic or materialman and secure to him a superior lien upon what he put on the land in the way of a complete and independent structure and, thus prevent the operation of the rule that would give an existing mortgage superiority as to the building at the expense of one furnishing labor or materials.

Equity and justice clearly favor the plaintiff. When a building or improvement as an entirety is placed upon or added to land under a mortgage it is a windfall so far as the mortgagee and his security are concerned. The policy of the statute in question which secures to the mechanic and materialman a lien superior to the mortgage rests upon the principle that no injustice is done in preventing the holder of the older lien from appropriating the labor and material of others and thus receiving as a matter of pure good fortune a material enhancement of a mortgage security.

The state acquired no lien upon the building involved in this lawsuit until the house was built. Whether any building would ever be annexed to the land after the mortgage was executed was purely a matter of speculation. At most any prospective enhancement of the security after the execution of the mortgage was wholly contingent. Before that contingency occurred the legislature changed the law to give the party a superior lien on the structure and the right to foreclose upon and remove it. The state’s security upon which it made the loan was not thereby diminished. While we do not wish to imply that a right may never become vested by contract in a contingency, the right involved in this case has not become so vested as to make it beyond the legislative power to amend the law as was done by chapter 155. A vested right is generally defined as an immediate or fixed right to present or future enjoyment and one that does not depend upon an. event that is uncertain. 11 Am Jur 1199, Constitutional Law, § 370; Clarke v. McCreary, 12 Smedes & M. (Miss) 347, 353; Marshall v. King, 24 Miss 85, 90; Oriental Bank v. Freeze, 18 Me 109, 36 Am Dec 701; Edworthy v. Iowa Sav. & L. Asso. 114 Iowa 220, 86 NW 315, 316, citing Louisville & T. Turnp. Road Co. v. Boss, 19 Ky L Rep 1954, 44 SW 981; Gladney v. Sydnor, 172 Mo 318, 72 SW 554, 556, 60 LRA 880, 95 Am St Rep 517.

It does not appear that the state by its mortgage had a right to claim a first lien upon every building or improvement that was placed upon the mortgaged land as against an agreement between the landowner and a third party that such building should be and remain personal property. Mathews v. Hanson, 19 ND 692, 124 NW 1116, supra; Holt v. Henley, 232 US 637, 58 L ed 767, 34 S Ct 459, 32 Am Bankr Rep 161.

In this connection it is interesting to note the case of Craig v. Herzman, 9 ND 140, 81 NW 288, affirmed in Red River Valley Nat. Bank v. Craig, 181 US 548, 45 L ed 994, 21 S Ct 703. While this case ultimately turns upon the determination that an alteration of the law pertaining to the enforcement of a mechanic’s lien amounted to an enlargement of the remedy considerable weight was given to the fact that such enlargement did not affect the original security covered by the mortgage. This court observed that “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. James River Lumber Co. v. Danner, 3 ND 475, 57 NW 343. Hence, if appellant’s contention that its contract rights are impaired be correct, it will follow that the mechanics’ lien 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. . . . 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 cóuld'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.” 9 ND pp. 143, 144, 81 NW 288.

Before the materials were furnished by the Dunham lumber Company the law was changed so as to give the right to the one furnishing material to assert a lien on the building constructed of such material superior to that of the state’s pre-existing mortgage. At the outset of the transaction, the plaintiff in compliance with the statute gave notice of its intention to claim a lien upon the premises under the new law. The owner of the real estate obtained the material and erected the building knowing that the material was furnished in contemplation of the lien for which the statute provided. The effect of the statute under these circumstances is the same as if the parties had specifically contracted that the property should remain personal property and never become attached to or become a part of the real estate as against the lien of the plaintiff for material. The statute providing for this lien does the state no injustice. 'It rests upon equitable principles. It, in no way, reduces the state’s mortgage security nor does it deprive the state of any vested right. The law at the time the mortgage was given while contemplating that improvements subsequently annexed to the real estate would be covered by the mortgage also contemplated that structures might be erected or moved upon the mortgaged lands under such conditions that they would never become annexed to the real estate or become a part thereof. The statute operates as though it were an agreement between the landowner and the materialman to the effect that the building should remain personal property. It thus prevents annexation as against the claim of the mortgagee. The mortgagee’s right attaches only to annexations. The statute does not impair that right. It merely operates to do by legislative enactment that which the owner and materialman could do by agreement. No vested or contractual rights of the mortgagee are disturbed. Affirmed.

Burr, Ch. J., and Christianson, Nuessle, and Burke, JJ., concur.  