The opinion of the court was delivered by
Marshall, J.:This is an action to enjoin the sheriff of Sedgwick county and defendant Richard Wilson from selling a homestead, under a judgment rendered in the district court of that county in an action in which the defendant herein, Richard Wilson, was plaintiff, and Sarah A. King, wife of this plaintiff *391Charles King, was defendant. Judgment was rendered in favor of the defendants. The plaintiff appeals.
The petition in this case alleges that the plaintiff and Sarah A. King are husband and wife, and have been for years occupying the premises in controversy as a-homestead; that in October, 1911, judgment was rendered in the district court of Sedgwick county, Kansas, in favor of defendant in this action, Richard Wilson, and against Sarah A. King, the wife of this plaintiff, for $1038.41, decreeing his claim to be an equitable mortgage upon the real property in controversy herein and awarding execution to collect the judgment, and if the judgment can not be collected without sale, awarding an order of sale against the homestead; that an order of sale was issued under that judgment; that the defendants threaten to sell this property under that order of sale; and that this plaintiff - was not a party to that suit. The defendants filed a demurrer to this petition, which was sustained by the court. The plaintiff then amended his petition by adding the f ollowing:
“That neither said order of sale heretofore issued as aforesaid, nor the judgment upon which the same was based, is on account of any lien for taxes against said premises, nor for the payment of any obligation contracted for the purchase of said premises, nor for the erection of any improvements upon said premises.”
The defendants again interposed a demurrer to the petition as amended, which was overruled. They then answered, setting up the petition of Richard Wilson in the former action against Sarah A. King. In that action the plaintiff therein, Richard Wilson, alleged that Sarah A. King was indebted to him upon a promissory note for $805, which recited that this sum was loaned by him to Sarah A. King to be used in the building of a house and improvements on the property in controversy, and alleged that the money advanced by Wilson to her was used by her for the purpose of building the house on the real property mentioned, and that *392it was understood that Sarah A. King would execute a mortgage on the property to Richard Wilson to secure the payment of'the money advanced. Trial was had, and judgment was rendered in favor of the plaintiff, Wilson, for $1038.41, decreeing the same a specific lien and claim and equitable mortgage upon the real property, prior to and superior to all other liens or claims from the date of filing the petition in that-action.
All óf the allegations of plaintiff’s amended petition were either admitted by the pleadings or. upon the trial, or were proved without contradiction, except the allegation “That neither said order of sale heretofore issued as aforesaid, nor the judgment upon which the same was- based, is . . . for the payment of any obligation contracted for the purchase of said premises, nor for the erection of’ any improvements upon said premises.’’
The evidence on behalf of the defendants in this action consists of the files in the former action. The plaintiff, in rebuttal, introduced what is called a “final statement of court,” which appears to be remarks made by the court at the time of rendering the judgment in the former action. The court, in the present action, would not allow the plaintiff to prove that the order of sale under which the sheriff was undertaking to sell the real estate, nor the judgment upon which the same was based, was not for the payment of any obligation contracted for the purchase of the premises, nor for the erection of any improvements thereon, and sustained the objections of the defendants to all such evidence. This excluded evidence • was not produced on the motion for a new trial, and is not set out in the abstract.
The matters complained of are: (T) Sustaining the demurrer to plaintiff’s first petition. (2) That the former judgment does not bind the plaintiff in this action. (3) Excluding evidence to prove that the former claim and judgment was not for improvements, *393and that judgment should have been rendered for the plaintiff on the evidence.
(1) When the plaintiff filed the amended petition, after the court had sustained a demurrer to the petition as first filed, whatever error there may have been in the order sustaining such demurrer became immaterial. (Moore v. Wade, 8 Kan. 380, 385; Cannon v. Kreipe, 14 Kan. 324; Briggs v. Tye, 16 Kan. 285; U. P. Rly. Co. v. Estes, 37 Kan. 229, 231, 15 Pac. 157.) This matter would not now be considered, but for the fact that the plaintiff argues that upon the evidence introduced” judgment should have been for him'. Was it necessary for the plaintiff to allege that the former j udgment was not for an obligation contracted for the purchase of the premises, or for the erection of any improvements thereon? In suits for the protection of-the homestead right it is not necessary to allege that the debt sought to be enforced against the property is not embraced within any of the exceptions. (Holcomb v. Hood, 8 Ky. Law Rep. 255, 1 S. W. 401; Staines v. Webb, 11 Ky. Law Rep. 36, 11 S. W. 508; Morehead v. Morehead, 16 Ky. Law Rep. 34, 25 S. W. 750; Shirley v. Russell, 23 Ky. Law Rep. 33, 62 S. W. 483; Nichols v. Sennitt, &c., 78 Ky. 630; Snapp, &c., v. Snapp, &c., 87 Ky. 554, 9 S. W. 705; Bach v. May, 163 Ill. 547, 551, 45 N. E. 248, and cases there cited; Huening v. Buckley, 87 Ill. App. 648; 21 Cyc. 636, 637; Thompson on Homesteads and Exemptions, §§ 701, 704.)
If this were a criminal pleading it would not be necessary to set out these exceptions. (The State v. Thompson, 2 Kan. 432; City of Kansas City v. Garnier, 57 Kan. 412, 46 Pac. 707; The State v. Thurman, 65 Kan. 90, 68 Pac. 1081; The State v. Buis, 83 Kan. 273, 111 Pac. 189.)
(2) Does the judgment in favor of Richard Wilson and against Sarah A. King bind the plaintiff in this action? The property in controversy was the homestead of the plaintiff and his wife, Sarah A. King. *394The constitutional provision (Const., art. 15, § 9) and the statute concerning homesteads (Gen. Stat. 1909, § 3646) both read:
“A homestead to the extent of one hundred and sixty acres of farming land, or of one acre within the limits of an incorporated town or city, occupied as a residence by the family of the owner, together with all the improvements on the same, shall be exempted from forced sale under any process of law, and shall not be alienated without the joint consent of husband and wife, when that relation exists; but no property shall be exempt from sale for - taxes, or for the payment of obligations contracted for the purchase of said premises, or for the erection of improvements thereon: Provided, The provisions of this section shall not apply to any process of law obtained by virtue of a lien given by the consent of both husband and wife.”
It should be noted that “no property shall be exempt . . . for the payment' of obligations contracted . . . for the erection of improvements thereon.” In Nichols v. Overacker, 16 Kan. 54, this court said:
“There is no homestead-exemption law as against obligations contracted for the purchase-money. As to such obligations; the rule is just the same as if no exemption-law had ever been adopted.' And land held as a homestead is, with respect to such obligations, governed by just the same rules as if it were not a homestead.” (p. 58.)
The above is quoted in Tyler v. Johnson, 47 Kan. 410, 412, 28 Pac. 198, and is the firmly fixed law of this state. (See, also, Hurd v. Hixon & Co., 27 Kan. 722.)
Under the laws of this state the wife has an interest in the homestead property, although -the title thereto may be in the husband, and she has a right to prosecute an action for the protection of that interest. In Gapen v. Stephenson, 17 Kan. 613, this court said:
“Myra E. Gapen was not a party to the action in which the attachment was issued, the judgment rendered, or the sale made. None of her rights could be prejudiced by any judgment, decree, or order of the *395court to which she was neither a party nor privy. If the farm in controversy is a homestead, ih a proper proceeding the wife can be fully heard, and the law will give her a time, and place, and tribunal to establish her legal claims.” (p. 617.)
“The wife of the head of a family has such an interest in the'homestead as enables her to'intervene and claim the property as exempt or institute an independent action therefor. . . . The wife and minor children of the debtor may maintain an action as beneficiaries of the exemption to recover or defend the homestead, especially when the husband refuses to join in the suit or has abandoned his family.” (21 Cye. 624, 635.)
It seems hardly necessary to say that each spouse has the same right to protect the homestead interest which the other has.
If the judgment was for improvements, there is no homestead exemption. If it was not for improvements is this plaintiff bound by a finding that it was for improvements ? If he is concluded by that finding he has no chance to be heard nor to protect his homestead rights. There is only one way open to the plaintiff, and that is to compel the j udgment creditor, in an ac-. tion in which this plaintiff has a right to be heard, to show that his judgment was rendered on a claim for improvements. There are authorities that seem to hold that the plaintiff is bound by the judgment. Among these are Nichols v. Overacker, supra, and Tyler v. Johnson, supra. In those cases both husband and wife were parties to the action in which the judgment was rendered. The weight of authority and better reasoning is that such a judgment does not bind- the spouse not a party to it. (Seay v. Fennell, 15 Tex. Civ. App. 261, 39 S. W. 181; Silk v. McDonald, 4 Neb. [Unof.] 34, 93 N. W. 212; Maas v. Morgenthaler, 136 App. Div. 359, 120 N. Y. Supp. 1004; Gustin v. Crockett, 44 Wash. 536, 87 Pac. 839; Moore v. O’Barr, 87 Ga. 205, 13 S. E. 464; Price v. Hudson et al., 125 Ill. 284, 17 N. E. 817.)
We therefore hold that the judgment in the former *396action does not preclude the plaintiff in this action from setting up his homestead rights against the judgment creditor and the sheriff, who are attempting to sell under that judgment.
The j udgment in that action decreed the claim of the plaintiff therein an equitable mortgage and foreclosed that mortgage. Both the husband and wife are necessary parties to foreclose mortgages on homesteads. (Hofman v. Demple, 53 Kan. 792, 37 Pac. 976; Willis v. Whitead, 59 Kan. 221, 52 Pac. 445.)
(3) There remains another question to dispose of. The plaintiff was not permitted to prove that the claim on which the judgment was founded was not for purchase price or for improvements. The evidence ex- - eluded was not produced on the motion for a new trial. Error in the exclusion of this evidence can not be considered. (Civ. Code, § 307; Davidson v. Timmons, 88 Kan. 553, 558, 129 Pac. 133; Walter, Adm’r, v. Calhoun, 88 Kan. 801, 129 Pac. 1176; Williams v. Withington, 88 Kan. 809, 812, 129 Pac. 1148; Cheek v. Railway Co., 89 Kan. 247, 257, 131 Pac. 617; O’Neal v. Bainbridge, 94 Kan. 518, 146 Pac. 1165.)
This does not dispose of the case. The plaintiff contends that on the evidence introduced judgment should have been rendered in his favor instead of in favor of the defendants. The plaintiff established all the allegations of his petition except “That neither said order of sale heretofore issued as aforesaid, nor the judgment upon which the same was based, is . . . for the payment of any obligation contracted for the purchase of said premises, nor for the erection of any improvements upon said premises.”
It was not necessary for him to allege this, neither was it necessary for him to prove any of these exceptions. The burden was upon the defendants to show that the claim on which the judgment was based was for some one of these exceptions against which there *397is no exemption. In Hurd v. Hixon & Co., 27 Kan. 722, this court said:
“In an action brought by the purchaser to obtain an injunction restraining the judgment creditor from enforcing his judgment, such creditor may offer testimony showing that the judgment was rendered upon, an obligation contracted for the purchase of the premises or for the erection of improvements thereon, thereby showing that the property is not exempt from sale under the judgment.” (p. 727.)
This the defendants did not do except by the recitals contained in the judgment. These recitals, so far as they affected the plaintiff’s homestead right, did not bind him. He was not a party to the former action, and has not had an opportunity to be heard. On the evidence introduced judgment should have been rendered for the plaintiff. But for the fact that the character of the claim on which judgment in the former action was rendered has not been shown, judgment for the plaintiff would now be directed. As it is, the judgment is reversed, and a new trial is granted.