
    STEPHENS v. DOXEY.
    No. 3614.
    Decided May 7, 1921.
    (198 Pac. 261.)
    1. PLEADING-UNNECESSARY ALLEGATION OF PERFORMANCE OF CONDITION Precedent May be Stricken out on Motion. In a suit to foreclose two mortgages, it was not error to strike out allegations of the complaint that plaintiff performed all things required of him; same being surplusage, no such duty resting on plaintiff under the terms and conditions of the mortgages.
    2. Mortgages — General Allegation or Performance of Conditions Precedent Sufficient, Where Such Conditions Alleged in Complaint. In a suit to foreclose two mortgages, if the complaint alleges that they were given by defendant to plaintiff’s assignor as a consideration for the latter’s contract to build an apartment house on the mortgaged lots, a general allegation of due performance of the contract would be sufficient, under Comp. Laws 1917, § 6601.
    3. Pleading — Averment of Failure of Mortgagor to Apply Rentals to Mortgage May be Stricken as Surplusage, Where Mortgage does not Impose Such Duty. Where plaintiff sued to foreclose two mortgages, and defendant answered that plaintiff’s assignor, in consideration of said mortgages, agreed to erect on the mortgaged lots an apartment house, according to certain plans and specifications, payments on the notes secured by the mortgage not to begin until after completion of the building, it was not error to strike from the complaint averments made as grounds for a receivership, that defendant had not applied to the payment of the notes and mortgages, the rentals received by her for the apartments; no such duty devolving on defendant under the terms and conditions of the notes and mortgages sued on, and plaintiff having the right to meet the issue by way of reply.
    4. PLEADING — Answer Alleging Non-performance of Condition PRECEDENT TO SUIT TO FORECLOSE HELD NOT VULNERABLE TO GENERAL Demurrer. Where plaintiff sued to foreclose twcT mortgages, defendant’s answer, that plaintiff’s assignor, in consideration of the mortgages, agreed to erect an apartment house on the mortgaged lots, payments on the notes secured not to begin until after the completion of the building according to certain plans and specifications, and that the building had not been so completed, stated a defense, and, even if assailable by special demurrer, was not vulnerable to a general demurrer.
    5. Mortgages — Answer to Foreclosure Suit Alleging Nonperformance of Conditions Precedent Held Bad on Special Demurrer for Ambiguity and Uncertainty. In a suit to foreclose two mortgages given to plaintiff’s assignor in consideration for the erection of an apartment house on the mortgaged lots, payments not to begin until after the completion of the building according to certain plans and specifications, defendant’s answer that the building was incomplete, and not according to plans and specifications with respect to workmanship and materials, was ambiguous and uncertain, in that it did not allege in what particulars the building failed to meet the plans and specifications, or wherein it was incomplete, alleged no facts constituting fraud, and contained no statement of the kind or character of workmanship or materials to be used, so that a special demurrer to it was properly sustained..
    6. Judgment — 'Dismissal not Res Judicata, if not on Merits. A judgment dismissing plaintiff’s suit for foreclosure of certain mortgages on the ground it had been prematurely brought, the court making no finding as to the amount due on the mortgages and notes secured thereby, not being on the merits, is not res judicata at common law or under the statute. Comp. Laws 1917, § 6859.
    7. Contracts — 'Building Contractor Must Substantially Comply -with Contract. Under a contract for the erection of a building according to agreed plans and specifications, the law contemplates a substantial, but not punctilious, compliance therewith; the contractor not being permitted to profit by noncompliance with the contract, nor the owner to reap the benefits of the added value to his property by reason of labor performed and materials furnished by the contractor.
    
      8. Contracts — (Use and Enjoyment of Building not Acceptance of Faulty Workmanship or Inferior Material. Under a contract for the erection of a building according to certain plans and specifications, the fact that the owner had been in the use and enjoyment of the building did not amount to an acceptance of faulty workmanship or inferior material, and she was entitled to all the damages arising from nonperformance of the contract.
    
    9. Bills and Notes — Notice to Assignee of Assignor’s Contract, Made in Consideration of Note and Mortgage Assigned, Does not Charge Assignee with Liability for Breach. The fact that the assignee of certain notes and mortgages took the same with notice of his assignor’s contract to build an apartment house on the mortgaged lots, in consideration of the notes and mortgages, did not charge him with the assignor’s willful neglect to complete the building- according to agreed plans and specifications.
    10. Mortgages — Mortgagor, Who Refuses to Permit Performance of Mortgagee’s Contract to Build on Mortgaged Premises, Es-topped to Set up Nonperformance as Bar to Foreclosure. Where plaintiff’s suit to foreclose two mortgages was dismissed, the defense being that plaintiff’s assignor failed to complete the building of an apartment house for defendant on the mortgaged lots, as he agreed to do in consideration of the mortgages, and thereafter defendant refused to permit the building to be completed and the defects remedied, or to discharge her liabilities under the mortgages, and made no claim for credit for the damages, sustained by nonfulfillment of the contract, she cannot be heard to say in a court of equity, in a second suit to foreclose, that the mortgages are not now due, and that no foreclosure can be had at this time.
    11. Mortgages — Suit to Foreclose Only Form of Action Permitted to Recover Debt Secured by Mortgage on Real Estate. Under Comp. Laws 1917, § 7230, permitting but one action for the recovery of any debt or the enforcement of any right secured by mortgage on real estate, an assignee of notes and mortgages on lots on which the mortgagee agreed to build for the mortgagor adopted the proper form of action in bringing suit to foreclose the mortgages.
    
    12. Mortgages — Mortgagor, on Suit for Foreclosure, May Offset Damages by Failure oe Mortgagee to Fulfill Contract Make IN Considebation or Mobtgage. Where an assignee took two mortgages and the notes secured thereby with notice of his assignor’s contract to build for the mortgagor on the mortgaged lots, in consideration of the notes and mortgages, the mortgagor, in suit for foreclosure, should be permitted to offset all damages sustained by her by reason of the assignor’s failure to complete the building substantially in accordance with the contract.
    Appeal from District Court, Second - District, Weber County; A. E. Pratt, Judge.
    Action by Solomon C. Stephens, Jr., against Luella Doxey. Judgment for defendant, and plaintiff appeals.
    REVERSED AND REMANDED, with directions.
    
      E. T. Ilulanisld, of Ogden, for appellant.
    
      Geo. Halverson, of Ogden, for respondent.
    
      
      
        Ryan v. Irrigation Go., 36 Utah, 383, 104 Pac. 218; Christensen v. Realty Co., 42 Utah, 70, 129 Pac. 412.
    
    
      
      
         Woburn v. Bartholomew, 50 Utah, 566, 167 Pac. 1156.
    
   CORFMAN, C. J.

Plaintiff commenced this action in the usual form for the foreclosure of two mortgages given by defendant on city lots situated in Ogden, Utah, to secure the payment of two promissory notes dated November 4, 1914, aggregating a total sum of $13,000. The first of said notes, for $8,000, was made payable on or before 10 years after date in installments of not less than $60 per month in addition to the interest at 8 per cent, per annum from date, and the second, for $5,000, was made payable 10 years after date, with interest at 8 per cent, per annum from date. Interest on both notes was payable quarterly.

It was alleged in the complaint that the plaintiff is the owner and holder of the mortgages by assignment, and, as grounds for foreclosure, that the defendant had defaulted in the payment of interest due on the notes and the insurance and taxes on the mortgaged premises as stipulated in tbe mortgages; tbat at the time plaintiff had taken and accepted the notes and mortgages there was situated on said lots an apartment house of about the value of the sums mentioned in the notes, and upon which the plaintiff relied as security; that, by reason of defendant’s failure to keep and perform the covenants and agreements in the mortgages contained, plaintiff had elected and declared the principal sums on the notes to be due and payable. Facts as grounds for receivership were also alleged and a receiver prayed for pending foreclosure proceedings.

The defendant, after denying certain allegations of the complaint, as special defenses thereto pleaded affirmatively: That on or about the 4th day of November, 1914, when said notes and mortgages were executed and delivered, one W. J. Stephens, an uncle of plaintiff, for and in consideration of the $13,000 for which said notes and mortgages, were given, agreed to erect on said city lots, as per plans of F. C. Wood, an architect, a two-story apartment house according to certain specifications as in said agreement provided; that it Was also provided in said agreement that the said W. J. Stephens should pay off a mortgage of $650 then existing on said city lots, and that said Stephens also at said time orally agreed to move a dwelling house situated on said lots from the front to the rear thereof, and make certain repairs or improvements on said dwelling; that it was also agreed on the part of the said W. J. Stephens, as contractor, that the interest payments and payments on the principal sums of said notes should not begin until 90 days after the completion of said building; that the said W. J. Stephens willfully refused to complete said building; that the same has never been completed and now remains in an uncompleted state, and that both workmanship and materials on said building were defective and inferior from that called for under said contract; that said Stephens has refused to complete the same or substantially comply with his said contract after repeated demands made by the defendant for him to do so; that plaintiff took and acquired said notes and mortgages with notice and full knowledge of the equities existing between tbe defendant and tbe said contractor and for tbe purpose of cheating and defrauding tbe defendant.

Further answering tbe complaint, tbe defendant pleaded that on tbe 19th day of December, 1917, in an action then pending in the district court of Weber county, Utah, wherein tbe plaintiff herein was tbe plaintiff and tbe defendant herein was defendant, for tbe foreclosure of tbe said mortgages and upon tbe subject-matters of this action, it was adjudged and determined in said action that tbe plaintiff take nothing by his complaint, and that said action be, and tbe same was, dismissed accordingly; that after an appeal to this court was taken from said judgment said appeal was dismissed, and that thereupon said judgment of said district court thereby became final. Defendant also moved to strike certain allegations of tbe complaint with respect to performance on the part of the plaintiff of all things required of him by law or otherwise, and also the allegations with respect to grounds for a receivership, which motion was granted by the court.

Plaintiff assailed the defendant’s answer, with a demurrer both general and special, the latter upon the grounds that the answer was unintelligible and uncertain in this:

“That it cannot be ascertained from said answer what, if any, amount of damages defendant has sustained, or in what manner or how the building in said answer mentioned is' incomplete, or is in an uncompleted state, in what manner or how the workmanship therein is defective, or what materials were inferior in quality or the value thereof, or in what manner or in what way, or the value thereof, that the defendant was to be or was cheated or defrauded by any act in said answer stated.”

The demurrer was overruled. A reply to' the answer was filed by the plaintiff, in effect denying all the material allegations of the answer, and also affirmatively alleging that since the alleged former adjudication of the case by the district court the contractor, W. J. Stephens, had offered to complete said building in the manner and as defendant desired the same completed, but that the defendant had refused to permit the same to be done.

Upon the trial the issues were found in defendant’s favor and judgment entered dismissing the action of plaintiff’s cost. Motion for a new trial was made and denied. Plaintiff appeals, and assigns as errors: The sustaining of defendant’s said motion to strike out certain allegations of the complaint; the overruling of plaintiff’s demurrer to the answer; the making of certain findings by the trial court; that the evidence is insufficient to justify the judgment; and that the same is against law.

1. We think the first assignment of error relied upon by the plaintiff, the sustaining of defendant’s motion to strike certain allegations of the compláint, is wholly without merit. Plaintiff’s complaint was founded upon the defendant’s failure to observe and comply with the terms and conditions of a mortgage. No duty of performance of a condition precedent rested upon the plaintiff under the terms and conditions of the notes and mortgages sued upon, and therefore it, Was mere surplusage for the plaintiff to allege in the first instance performance on his part. Had the plaintiff alleged in his complaint that the notes and mortgages sued upon were given by the defendant as a consideration for the contract entered into between the defendant and the contractor, W. J. Stephens, an entirely different issue would have been presented by the complaint. In that case the general allegation of due performance of the contract would have presented an issue, and the general allegation of due performance would have been, under our statutory rules of procedure (Comp. Laws Utah 1917, § 6601), proper and sufficient.

So, too. were the averments as grounds for the receivership mere surplusage, and therefore properly stricken. These allegations, in substance and effect, were that the defendant had been in receipt of’rentals for apartments which she had not applied to the keeping of the covenants and agreements of the notes and mortgages. No such duty devolved upon the defendant under the terms and conditions of either the notes or mortgages attached to and made a part of the complaint; nor was any such duty shown or alleged at all by the complaint. While it is true the answer of the defendant, in a general way, pleaded as a special defense failure of performance of a builder’s contract and that the plaintiff had taken the notes and mortgages with notice of the conditions thereof and the equities existing between the contractor, W. J. Stephens, and the defendant, yet plaintiff had a right to meet that issue when properly pleaded by way of his reply. Plaintiff therefore suffered no prejudice by reason of the allegations being stricken from his complaint in the manner complained of by him.

The next error complained of by plaintiff, that of overruling his demurrer to the answer, presents a more serious question. The demurrer, as has been pointed out, was both general and special. Undoubtedly the answer stated a defense and was not vulnerable to a general demurrer. Therefore plaintiff’s demurrer, on the first ground stated by him, was properly overruled by the court. However, as pointed out, the plaintiff assailed the answer by his special demurrer upon the grounds that it was ambiguous and uncertain for the reasons specifically mentioned and set forth in said demurrer. ¥e think there is much merit in the contention made by plaintiff that the special defenses relied on by the defendant in her answer were not stated with sufficient clearness and certainty. It matters not whether the several affirmative matters pleaded in the answer are viewed as technical defenses, counterclaims for damages, or set-offs to the demands of the complaint, the plaintiff was entitled to the particular facts relied on by the defendant and to be advised as to what he had to meet.

As illustrative of the insufficiency of the answer relied upon by the defendant to defeat the demands of the complaint, it is charged that the plaintiff in taking the notes and mortgages sued upon had knowledge of a certain agreement entered into between W. J. Stephens, as contractor, and the defendant, as owner, whereby said'Stephens, as a consideration for said notes and mortgages, w*as to erect an apartment house for the defendant “as per plans drawn by F. C. Woods, architect,” and as per specifications in said contract set forth. This agreement also provides “that interest payments and payments on tbe principal of said notes and mortgages are not to begin until ninety days after the completion of said building. ’ ’ The answer then' proceeds to allege in a general way only “that said W. J. Stephens willfully refused to complete said building and has never completed said building, and the same is now in an uncompleted state and the work done thereon was of very defective workmanship and the materials of very inferior quality.” In what particulars the building fails to meet the plans and specifications, or how or in What way it is incomplete, or the material inferior or workmanship defective, the answer does not say. It is then charged that fraud was practiced on the defendant by the plaintiff and no specific facts alleged as constituting the fraud; that plaintiff took the notes and mortgages with notice of conditions imposed by said builder’s contract and all the equities existing between the said W. J. Stephens and the defendant, and that said Stephens did not substantially comply with the terms of said contract. While it is true that a copy of said agreement was attached to and made a part of the answer, the so-called “specifications” contained therein are so general in character that it sheds practically no light as to what the plans of the architect were to be, nor does it contain within itself any statement of the kind or character of the workmanship to be performed on the building, and only in a general way the kinds of materials to be used in the construction of the building. Therefore, for the reasons assigned in the special demurrer to the answer, we think the district court erred in not sustaining it.

3. Lastly, the plaintiff complains of the insufficiency of the evidence to support the findings and judgment of the trial court and that the judgment or decree dismissing the action is contrary to law. It appears as admitted facts in the record that upon the 4th day of November, 1914, the contract mentioned and set forth in' the answer was entered into between W. J. Stephens, a contractor and builder, and the defendant; that at the time the notes and mortgages sued upon by plaintiff were given to secure the contract price of $13,000; that said notes and mortgages were, on Jnne 30, 1915, indorsed and transferred to the plaintiff for a consideration of $10,000, which was used in paying for the construction of said building; that plaintiff took said notes and mortgages with notice of the terms and conditions of said contract;- that while the defendant defaulted in making payment of taxes on the mortgaged premises and in keeping the same insured as stipulated in said mortgage she should do, also in the payment of interest and installments to apply on principal sums as stipulated in said notes, the plaintiff, under a provision of the mortgages declares the principal sums owing on said notes due and brought a first suit in the district court to foreclose; and that upon the issues then joined the said court found for the defendant, among other things, that said building had not been completed and “that there was not, at the time of 'the commencement of this action, and is not now [December 19, 1917], anything due upon the promissory notes sued on in this action, but the court does not make any finding as to the amount, if anything, that is owing or may hereafter become due on said notes and mortgages, or either of them.” Predicated on the findings then made, a judgment Was rendered and entered by the district court dismissing the plaintiff’s action. An appeal was after-wards taken to this court, but subsequently dismissed without consideration upon merits.

It further appears, although not without some conflict in the evidence, that after the dismissal of said appeal to this court the contractor, W. J. Stephens, on or about May 26, 1919, took another contractor and builder to the building and had the defendant point out in what particulars she complained of the building not being completed according to contract. Thereafter said Stephens sent workmen to the building for the purpose of completing it in the particulars defendant had claimed and pointed out that it was incomplete and defective; but defendant refused to permit any repairs to be made or any work to be performed, although an offer was made to complete the building as desired by defendant. Some of the witnesses testified that the workmanship on the entire building was defective and the materials used of inferior' quality. It further appears somewhat in detail from the evidence that the building was not equipped with a sufficient hot-water furnace and boiler, and that the heating system installed by the contractor was inadequate to properly heat the building; that the porches were not properly completed and not as large as called for by the specifications; that the roof was of poor construction and leaked very badly; that the interior work throughout the building was rough and in some respects incomplete; that the foundation walls under the partitions were not properly placed, and as a result thereof the partition walls sunk, the plaster cracked and some of the doors sagged. It also appears from the evidence that the defendant personally expended, in order to remedy the defects and increase the capacity of the heating plant, approximately $500 and' the further sum of $385 for the placing of a new roof upon the building. The record further shows that in November, 1915, defendant leased the first apartment of the said building and has since been in possession of the building, drawing rentals therefrom amounting to not less than $175 per month.

In the particulars complained of by plaintiff the trial court made findings to the effect that the contractor, W. J. Stephens, willfully refused to complete said building and on or about September 1, 1915, abandoned the same and all work thereon, and never substantially completed the same in accordance with specifications, but “knowingly and willfully departed therefrom in material parts and that the work done thereon was very defective and the materials used of inferior quality; that the defendant took possession of the building without accepting the same and thereafter made demand upon said W. J. Stephens from time to time to complete said building according to said agreement which he afterwards refused to do; that the plaintiff took said notes and mortgages with knowledge of the said contractor’s failures and refusals, but paid to said contractor a consideration of $10,000 for said notes and mortgages, with knowledge that they were not to be paid for a period of 90 days after the completion of said building. ’ ’ The court also made findings with reference to defective workmanship and inferior materials entering into the construction of the building in accordance with the foregoing evidence. It was also found by the district court that the former suit had been begun and a judgment rendered dismissing that action as alleged in the answer and that since the rendition of that judgment the said contractor, "W. J. Stephens, had offered to make certain repairs on the building, which defendant refused to permit him to make or to enter upon the performance-of any work on said building. The district court concluded from the findings made that the present action should be dismissed, and thereupon rendered judgment accordingly.

Before proceeding to discuss the sufficiency of the ' evidence to support the findings made and the judgment rendered by the district court it may be well to first consider the contention made by the defendant that the judgment rendered by the district court in the former case w'as res judicata and was a final determination of the issues involved in this action. The defendant insists that the former judgment was not only sufficiently pleaded, but absolutely supported by proof; that the parties to this action are the same, the pleadings practically the same, the subject-matter identical, and practically the same findings, conclusions of law and judgment as in the former action. Nevertheless we think the record of the former case conclusively shows that the adjudication then made by the court was not upon the merits and determinative of one thing only, that the suit had been prematurely brought. If a judgment, for any reason, is rendered upon a ground not involving the merits of a controversy, the doctrine of res judicata does not apply. Peck v. Easton, 74 Conn. 456, 51 Atl. 134; Armstrong v. Manatee County, 49 Fla. 273, 37 South. 938; Pyle v. Piercy, 122 Cal. 383, 55 Pac. 141; Beronio v. Ventura County, 129 Cal. 232, 61 Pac. 958, 79 Am. St. Rep. 118; Robb v. New York & C. Gas Coal Co., 216 Pa. 418, 65 Atl. 938.

The court in the former action, as the record thereof clearly shows, made no attempt to determine the merits of the case as between the parties; but from the judgment roll thereof offered and received in evidence in this case, it expressly appears that the court did not make any finding “as to the amount, if anything, that is owing or may hereafter become due on said notes and mortgages.” It is provided by our statute (Comp. Laws Utah 1917, § 6859) that “a final judgment dismissing the complaint, either before or after trial, does not prevent a new action for the same cause of action, unless it expressly declares, or it appears by the judgment roll, that it is rendered upon the merits.” "We think the finding of the district court above quoted was tantamount to saying that the action had been prematurely brought, that there was nothing before the court to enable it to say more than that, by reason of all the facts and circumstances disclosed by the evidence no recovery could be had on the notes and mortgages at that time. The ultimate rights and liabilities between the parties themselves were not adjudicated nor determined in the slightest degree, therefore there is nothing in the judgment relied upon that operates as an estoppel in the present action.

This case, in many of its aspects, is a most peculiar one, and presents many difficulties in attempting to arrive at the legal rights of the respective parties. The plaintiff seems to have proceeded in the trial on the theory that he was entitled to a full recovery of the amounts agreed upon and stipulated for under the terms and conditions of the notes and mortgages held by him, regardless of the admitted fact that he took them with notice. The defendant’s theory seems to be that the building was not substantially completed, that the workmanship upon the building was bad, and the materials entering into its construction so inferior that no recovery on the notes and mortgages can be permitted at any time or at all. ¥e may remark that one of the greatest difficulties to contend with is how to determine from this record just what class of workmanship and materials are required to satisfy the contract entered into between the contractor and the defendant The contract pleaded by the defendant, within itself, certainly does not prescribe, and, as we view the evidence in the case, very little, if any, light is shed upon the question, as to what kind of workmanship and materials Would satisfy the contract. Ordinarily, in this class of cases, where a contract is entered into for the erection of a building, the details are worked out through the medium of plans and specifications made a part of the contract, so that the kind and character of the completed structure called for can be readily ascertained.

In the present ease, about all the contract calls for in the way of building is a two-story apartment house. The end contracted for seems to have been attained, although, from the standpoint of the defendant, not very satisfactorily. She complained of, and we think successfully proved at the trial of this case that the heating apparatus was inadequate to properly heat the building and that the roof badly leaked. According to the evidence, these defects were remedied by her at her own expense. Some other details of faulty workmanship and inferior materials used were testified to by the witnesses in defendant’s behalf, but to what extent the contractor departed from the specifications with respect thereto was neither pleaded nor proved. In this class of cases the law contemplates a substantial compliance with the plans and specifications; that any structure should be so substantially erected and completed as to subserve the purposes and uses for which it is intended. Otherwise, the owner is not required to accept it and pay the Contract price. It Would be idle to review the modern decisions of the courts in this or other jurisdictions, with a view of applying the principles of law or equity announced therein to the facts and circumstances disclosed by this record. "We may remark, however, that in this class of cases the trend of decisions in recent years has been to hold that there must be a substantial, not a punctilious, performance of builder’s contracts. So, too, it is generally held that on the one hand the contractor may not be permitted to profit by reason of his. noncompliance with contract, while on the other hand the owner will not be permitted to reap the benefits of the added value to his property where, of necessity and in the very nature of things, substantial benefits have accrued by reason of the labor performed and the materials furnished by the contractor for the, building.

While defendant in the present case, since September, 1915, has been in the use and enjoyment of the building, that, in and of itself, does not amount to the acceptance of faulty workmanship or inferior material. Under such circumstances she is entitled, by way of recoupment, to all the resulting damages arising from nonperformance of contract. Ryan v. Irrigation Co., 36 Utah, 383, 104 Pac. 218; Christensen v. Realty Co., 42 Utah, 70, 129 Pac. 412; Lloyd, Building Contracts, p. 39. However, under the facts and circumstances of this case, we do not think there is a great deal of merit in the contention made by defendant, nor in the finding made by the district court in support thereof, that the building, in question has not been substantially completed, nor’ that the same was not accepted subject to her right to make claims for faulty workmanship and inferior materials. The contract relied upon by defendant, and the notes and mortgages executed by her, were all a part of and entered into the same transaction. The parties are in a court of equity, and we are therefore compelled to take into consideration the situation of the respective parties and all the facts and circumstances surrounding them.

It is undisputed that plaintiff took the notes and mortgages with notice of the contract while the building was in course of construction. So far as the evidence shows, he in good faith paid- to the payee of the notes approximately $10,000 for the transfer of the notes and assignment of the mortgages. Notice of the contract, in our opinion, however, did not charge him with the willful neglect and conduct of the contractor. But, be that as it may, since the former suit, the evidence shows, we think quite conclusively, that defendant has not only refused to permit the building to be completed, and the defects pointed out by her to the contractor remedied, but has. also refused to pay and discharge the liabilities: incurred by her under the terms and conditions of tbe notes and mortgages. Moreover, under tbe facts and circumstances disclosed by tbis record, she has made no claim whatever, at any tinte, for credit by reason of the damages she may have sustained by reason of the nonfulfillment of the contract and has sat supinely by, disregarding every obligation to be performed on her part in order to afford the plaintiff security for the money invested in the notes and mortgages executed by her.

Taking into consideration the situation of the parties, and the facts and circumstances surrounding them since the former judgment in this case, we are of the opinion that the defendant may not be heard to say in a court of equity that the notes and mortgages are not now due and owing and that no foreclosure can be had at this time. Under our statute (Comp. Laws Utah 1917, § 7230) there can be but one action for the recovery of any debt or the enforcement of any right secured by mortgage on real estate. Coburn v. Bartholomew, 50 Utah, 566, 167 Pac. 1156. It must therefore be held.that the plaintiff in this case adopted the proper form of action in bringing suit to foreclose the mortgages held by him against the defendant. However, as plaintiff took the mortgages with notice of the contract entered into between the defendant and the contractor, ~W. J. Stephens, the defendant, upon proper pleadings and showing made, should be permitted to offset against said notes and mortgages any and all damages she may reasonably have sustained by reason of the failure of the said contractor to erect and complete the building substantially in accordance with the contract, or as reasonably contemplated by the parties to it.

For the reasons stated, the judgment of the trial court, dismissing plaintiff’s action, is reversed, vacated and set aside. Let the cause be remanded to the district court with directions that the plaintiff be granted a new trial, that plaintiff’s special demurrer to the defendant’s answer be sustained, and defendant permitted to make amendments thereto, counterclaiming for damages in accordance with the views herein expressed. Appellant to recover costs.

WEBER, GIDEON, and THURMAN, JJ., concur.

FRICK, J.

I concur in tbe conclusions of the CHIEF JUSTICE. I feel constrained to add, however, that, while I am thoroughly convinced that the rule adopted by the courts that in actions on building contracts the contractor should not be permitted to recover on the contract, unless he shows that he has, substantially, at least, complied with its terms and conditions is just, sound and wholesome, yet I am also convinced that, where the action is in equity and it appears that the owner of the building is using it, and is benefited by its use, and where the damage for, defective materials and improper workmanship can be ascertained and adjusted between the parties, relief in toto should not be denied. Courts of equity are not created to enforce penalties, but they were called into existence to ascertain and preserve rights and to administer the law in accordance with the dictates of conscience, and so as to reflect equity and justice between the parties. Where, therefore, the owner of a building or structure in question can apply, and does apply, it to the use for which it was intended, and the damage which arises by reason of improper workmanship or defective materials can be ascertained and fixed in accordance with the established rules of evidence, the courts should not deny the contractor a right to recover, but should permit him to recover what, in view of the facts and circumstances, is equitable, just, and right. Such an adjustment cannot injure any one and tends to maintain the respect for the law which is so essential in all governments.

This case affords a striking example of how injustice might result from denying the contractor any relief whatever. In this case the defendant is in fact enjoying the labor and materials furnished by the contractor, and is receiving an income from the building; yet, if this judgment is to prevail, she may do so without making any compensation therefor whatever. Moreover, it appears from the record that the contractor, with his ow|n money, paid off and had discharged a mortgage which was a lien on defendant’s property ánd. bas thus relieved her property from a valid and subsisting lien. Notwithstanding that fact, however, he is denied all relief. It may he that he may have some remedy with regard to that matter, but, so far as this record discloses, it is hard to conceive why he should be denied relief in this proceeding, and, further, Why if this judgment stands, he is not entirely precluded from obtaining any relief. Moreover if she can succeed in preventing a recovery upon the ground that the workmanship and materials are defective now, she may do- so at any future time and is thus permitted to use another’s labor and material as a permanent investment without rendering any consideration therefor whatever. This case should therefore proceed in accordance with the principles of justice and equity, and while the defendant should be awarded adequate damages and compensation for all defects she should not be permitted to hold the building discharged from all claims of the contractor or his assignee.  