delivered the opinion of the court.
This action was brought to recover of the defendants the sum of $497.75, claimed to be the balance due to the plaintiff upon a building contract whereby plaintiff undertook to erect and complete for the defendants, on a lot owned by them in Butte, a two-story and basement brick house in accordance with the plans and specifications, and for which the defendants promised to pay to plaintiff $2,950. Enforcement of a mechanic’s and material man’s lien for the alleged balance was also sought. At the conclusion of the evidence in behalf of the plaintiff, the court, trying the cause without a jury, ordered judgment for the defendants, and the plaintiff appeals.
The contract provides that all the work shall be done and the building completed in accordance with the plans and specifications, and that the defendants shall make payments from time to time during the progress of the work, the final payment of $1,350 to be made “when the said building is finally completed and accepted by the said second parties, and the said second parties are furnished with satisfactory proof that all claims against the said building have been paid by the said 'first -party, and that no liens exist on the said property for or on account of the work done thereon or the material furnished *167in the erection of the same. ’' One of the specifications requires plastering, without reference to any particular story or room, and without exception or exclusion of any particular portion of the building. The plans call for a chimney flue in the east half of the basement.
In the complaint it is alleged that the plaintiff completed the building under, and in all respects fully complied with and performed all the conditions of, the contract. These allegations the defendants, by their answer, denied. The evidence failed to show that the defendants had been furnished with proof “that all claims against the said building” had been paid, or that no liens for work or materials existed. Although the plaintiff by deposition testified generally, without descending to details, that he completed the building as provided for in the contract, yet his witnesses made it appear, and clearly, that the east room of the basement, an apartment some 31 feet long by 12 or 13 feet wide, adjoining the dining room and kitchen, which comprise the western part of the basement, was never plastered, and that no flue was ever built in that room. There was no evidence whatever tending to disclose an understanding of the parties, or in respect of the uses intended to be made of this room, from which the inference that it need not be plastered appeared or could be deduced. No effort was made by the plaintiff to show that the particulars in which the contract had not been performed were unimportant, or that the nonperformance was the result of mere oversight; nor what the cost of remedying the defects or deviations would be. The plaintiff informed the defendants that the building was completed according to the plans and specifications, and offered it to them for their acceptance; but they refused to accept it. The platntiff then locked up the house, and refused to turn it over to the defendants, for the reason that the last payment had not been made; whereupon they entered the house from the second-story window, and asked the plaintiff for the keys. He told them that he would deliver the keys upon their making the final payment. This the defendants refused to do; but had keys made, opened the doors, and took possession of the house.
*1681. No error was committed in ordering judgment for the defendants. The contract specifies the event upon the happening of which, and of others, the last payment should be made, namely, the production of satisfactory proof that there were no claims or liens against the building. This provision is reasonable, and one which, in view of the statutes of Montana permitting direct liens to be filed by subcontractors, ordinary prudence would suggest for the protection of the owner of the property about to be improved. The performance of this condition, or its waiver, is precedent to the right of payment, — the final installment will not mature until the condition shall have been performed.
2. This is not an action to recover what the services and materials were reasonably worth. It is to recover the agreed price fixed by an express contract in writing. The evidence does not tend to prove a substantial performance by the plaintiff of the contract; nor, under the circumstances, can it successfully be maintained that the failure to plaster, or the omission to build the flue, was unintentional or a mere oversight. The plaintiff may lawfully insist upon payment only when the conditions on which payment is due have been performed. “While slight and insignificant imperfections or deviations may be overlooked on the principle of lDe minimis non curat lex,"1 the contract in other respects must be performed according to its terms. When the refusal to proceed is willful, the difference between substantial and literal performance is bounded by the line of de minimis. * * * Substantial performance is not sufficient, except when it is understood as excluding only such unsubstantial differences as the parties are presumed not to have had in contemplasion when they made the contract. ’ ’ (Van Clief v. Van Vechten, 130 N. Y. 571, 29 N. E. 1017.)
But it is argued that the defendants, by taking possession of the building, waived any further compliance on the part of the plaintiff with the terms of the contract. We think, however, there was not sufficient proof of a waiver or of an acceptance of the building, as in compliance with the contract, *169to have justified the court in deciding the cause for the plaintiff. The doctrine applicable to this subject finds clear expression in the opinion of Judge Comstock, in the leading case of Smith v. Brady, 17 N. Y. 173, approved in Van Clief v. Van Vechten, supra. That able judge said:
“The owner of the soil is always in possession. The builder has a right to enter only for the special purpose of performing his contract. Each material as it is placed in the work becomes annexed to the soil, and thereby the property of the owner. The builder would have no right to remove the brick or stone or lumber after annexation, even if the employer should unjustifiably refuse to allow him to proceed with the work. The owner, from the nature and necessity of the case, takes the benefit of part performance and, therefore, by merely so doing, does not necessarily waive anything contained in the contract. To impute to him a voluntary waiver of conditions precedent from the mere use and occupation of the building erected, unattended by other circumstances, is unreasonable and illogical, because he is not in a situation to elect whether he will or will not accept the benefit of an imperfect performance. To be enabled to stand upon the contract, he cannot reasonably be required to tear down and destroy the edifice if he prefers it to remain. As the erection is his by annexation to the soil, he may suffer it to stand, and there is no rule of law against his using it without prejudice to his rights. * * * We only say that, according to the settled law in this state, the plaintiff cannot recover the payments which by the terms or true construction of the contract are due only on condition of performance by him, unless he can show such performance, or prove that it has been waived. And the law does not adjudge that a mere silent occupation of the building by the owner amounts to a waiver; nor does it deny to him the right so to occupy, and still insist upon the contract. The question of waiver of the condition precedent will always be one of intention, to be arrived at from all the circumstances, including the occupancy. To conclude, there is, in a just view of the question, no hardship *170in requiring builders, like all other men, to perform’ their contracts, in order to entitle themselves to payment, where the employer has agreed to pay only on that condition. It is true that such contracts embrace a variety of particulars, and that slight omissions and inadvertences may sometimes very innocently occur. These should be indulgently regarded, and they will be so regarded by courts and juries. But there can be no injustice in imputing to the contractor a knowledge of what his contract requires, nor in holding him to a substantial performance. If he has stipulated for walls of a given material, and with a hard inside finish, he knows what he is to do, and must perform it. If he has engaged for a given number and size of windows, joist, beams, and sills, he cannot, with the specifications before him, innocently depart from his contract. If he fails to perform when the requirement is plain, and when he can perform if he will, he has no right to call upon the. courts to make a new contract for him; nor ought he to complain if the law leaves him without remedy. ’ ’ Anderson v. Todd (N. D.), 77 N. W. 599, also contains a valuable and instructive discussion of the questions presented in the case at bar.
It does not appear that the defendants paid any part of the last installment of the agreed price with knowledge of the plaintiff’s failure to comply with the terms of the contract under which the work was to be done.
The judgment is affirmed. Let remittitur issue forthwith.
Affirmed.