Defendant Shepard and one Little were severally the -owners of contiguous lots. Each contracted with one Stoddard for the erection of a dwelling house on his lot, and about the same time the two agreed to jointly erect a barn on the line between the lots, so that part of it would be on each lot, and appurtenant to the dwelling house being erected thereon. Pursuant to this arrangement, they contracted with Stoddard for the erection of the barn. Stoddard built the two houses, and also the barn, the latter being so located that five feet more of it was on one lot than on the other, and one end of it better finished inside than the other; but on which lot the larger part of the barn was situated, or which end was the better finished, does not appear. Neither does it appear what the dimensions of the barn were. The defendants Smith & Co. furnished to Stoddard material for the construction of each house, and also of the barn. Shepard and Little paid Stoddard in full, but the latter failed to pay Smith & Co. Thereupon Smith & Co. filed separate claims for liens on the two houses, and also a claim for a lien on the barn and both lots jointly for the material furnished for the barn.
The plaintiffs, who had furnished material to Stoddard for Shepard’s house, having commenced this action to enforce their lien on his house and lot, and having made Smith & Co. defendants, the latter interposed an answer alleging the foregoing facts, and also that the amount due them for material for Shepard’s house was $559.42, and for material for the whole barn $424.02.
They further alleged that the matter as to the material for the *270barn was set up “so as to protect their rights in the premises on the said claim, and that they intended to bring a separate action to enforce said lien if the same cannot be fully enforced herein.” They then asked for judgment against Stoddard for $559.42, and that said judgment be declared a lien on Shepard’s house and lot, and that, if the court could not give full relief upon the last claim, (material for the barn,) it may make such order and decree as may protect their rights in the premises, and that they might have such other and further relief as to the court might seem proper. Shepard appeared and answered, but Stoddard, the original contractor, failed to appear.
The court ordered personal judgment in favor of Smith & Co. against Stoddard for the full amount due for material furnished for Shepard’s house, and one-half of the amount due for material furnished for the barn, and adjudged the same to be a lien on Shepard’s house and lot, and directed the premises to be sold to satisfy the .same.
Shepard, the appellant, concedes the correctness of this decision, so far as it relates to the material for his house, but contests it in so far as it allows a lien on his premises for half ($212) the material for the barn.
1. The first point which he makes is that there was no evidence that he bore any contract relations with Stoddard as to the erection of the barn; that the evidence shows that, as to that, the contract was exclusively between Little and Stoddard; and that his (Shepard’s) contract was merely with Little, and was to the effect that he would pay to Little half the expense of building the barn. We do not so construe the evidence. We think the legal effect of it is that, while Little made the contract with Stoddard, he did it in behalf of Shepard as well as himself, and that Stoddard was the contractor of both.
2. While undoubtedly Shepard and Little would each own in sev-eralty the part of the barn situated on his own lot, yet, by uniting in a contract for a single building partly on each lot, they consented to both lots being treated as one tract for the purposes of a lien for material or labor furnished in its erection. Consequently Smith & *271Co. had a right to file a single claim for a lien on the barn and both lots. But we are also of opinion that, notwithstanding their having done so, they might sever their claim so as to obtain judgment against each lot for the amount of material which went into the part of the barn situated thereon, provided they were able to show, and did show, what part or proportion of the material entered into the construction of each part of the building, and provided the rights of third parties are not thereby prejudiced. The court would, no doubt, have the power thus to apportion it, if necessary, for the protection of lien claimants or other incumbrancers of each lot, separately, and what the court might thus do for such purpose might be done on the petition of Smith & Co. themselves. This would work exact equity to all, and would do injustice to none.
And, notwithstanding the somewhat equivocal allegations and double prayer for relief in Smith & Co.’s answer, we think it was sufficient to authorize the court to adjudge their claim for material for the barn, as well as for the house, a lien on the premises. In fact, in view of the provisions of section nine (9) of the lien law, requiring all claims for liens to be determined and adjudged in the one action, we think it was the bounden duty of the court to do so. It may be that, inasmuch as Stoddard defaulted, the court had no right to order personal judgment against him for more than demanded in the answer, but Shepard has no right to object in behalf of Stoddard on that ground. All that he has any right to object to is the amount of the lien adjudged against his property. Personal judgment against Stoddard was not an essential prerequisite to the jurisdiction of the court to decree a lien on the premises. Stoddard, as the original contractor, may be what would be called a necessary party, but the rule as to parties is one adopted by the court itself merely for the purposes of- convenience and justice.
But while Smith & Co. had the right to sever the lien for material for the barn, yet, if they did so, it was incumbent on them to show affirmatively what part or proportion of the material entered into Shepard’s part of the building; that is, the part which stood on his lot. Had it appeared that both parts of the barn were built and finished alike, and that half stood on each lot, then the court would *272have been fully justified in adjudging one-half the amount of Smith & Co.’s claim to be a lien on Shepard’s premises. But it appears not only that the two parts were finished differently, but also that five feet more of the building (which for anything that appears might have been a very considerable part of it) stood on one lot than on the other, and there is no evidence as to what part-or portion of the material went into either. Consequently there was no basis whatever furnished by the evidence for the court’s apportionment. It was mere guesswork.
(Opinion published. 53 N. W. Rep. 89é.)
3. As to the application of the $400 paid by Shepard to Stoddard, and by him paid to Smith & Co., we can discover no material difference between the facts of this case and that of Jefferson v. Church of St. Matthew, 41 Minn. 392, (43 N. W. Rep. 74.)
Consequently the doctrine of that case must control this.
Any other rule would impose upon the subcontractor or material man a greater degree of care and attention in looking after the interests of the owner than required of the owner himself.
A new trial is ordered as to the claim of the respondent defendants set up in the second subdivision of their answer, (for material for a barn,) but as to the claim set up in the first subdivision (material for the dwelling house) the order appealed from is affirmed.