
518 P.2d 1168 (1974)
INTERMOUNTAIN ELECTRIC, INC., Plaintiff and Appellant,
v.
William R. BERNDT et al., Defendants and Respondents.
No. 12564.
Supreme Court of Montana.
Submitted January 15, 1974.
Decided February 15, 1974.
Drysdale, McLean & Scully, Bozeman, James A. McLean, argued, Bozeman, for plaintiff and appellant.
Berg, O'Connell, Angel & Andriolo, Bozeman, Charles F. Angel, argued, Bozeman, Landoe & Gary, Bozeman, for defendants and respondents.
*1169 HASWELL, Justice.
This action involves an attempted foreclosure of a mechanic's lien against a homeowner by an electrical subcontractor. The district court of Gallatin County, Hon. W.W. Lessley, district judge, sitting without a jury, entered findings of fact, conclusions of law and judgment for the defendant homeowners.
On September 8, 1971, William R. Berndt and Barbara A. Berndt, husband and wife, entered into a written agreement with Component Development Production Corporation as contractor for the construction of a dwelling house for a price of $21,800. The agreement and specifications provided that the contractor would furnish all labor and supply all electrical wiring, attached fixtures, and electrical heat, and specifically provided that the contractor would not have a right to sublet, transfer or assign the contract or any part thereof without the prior written consent of the homeowners.
In January, 1972, plaintiff-subcontractor, Intermountain Electric, Inc. entered into a verbal agreement with the contractor for installation of electrical service and electrical heat in the house being constructed by the contractor. The district court found that the subcontractor made no inquiry as to whose house was being constructed or as to the extent or limits of the contractor's authority. The subcontractor dealt exclusively with the contractor. The homeowners were not informed of this agreement nor did they consent in writing or verbally.
On January 17, 1972, an employee of the electrical subcontractor began installing the electrical service in the owner's house. The equipment was originally billed to the contractor. About the first part of February the employee submitted a bill to the contractor for the work done and materials supplied up to that time and attempted to collect from the contractor. However, the contractor communicated to the subcontractor's employee that it was broke. On February 4, 1972, the subcontractor left the job when it was only 40% completed. When the subcontractor was unable to obtain money from the contractor, he did not seek out the owners and ask them for payment, nor did he ever try to find the homeowners and ask if they wanted him to complete the electrical work.
The homeowners made payments of approximately $15,000 to the contractor under their agreement; these payments were made in approximately $5,000 installments, the last being made on December 3, 1971. The contractor has never requested any additional monies from the homeowners. After the contractor went broke the homeowners had to take over the completion of the dwelling house, and in so doing expended in excess of $8,000 in completing items called for by the plans and specifications in their agreement with the contractor. In addition thereto, the homeowners incurred a bill in the amount of $2,038.05 to Service Electric of Bozeman, Montana, to complete the installation of electrical service and electrical heat that had been voluntarily abandoned by the subcontractor. When the homeowners employed Service Electric to complete the electrical work, they had not learned the identity of subcontractor.
After being unable to collect against the contractor, the electrical subcontractor filed a mechanic's lien against the owner pursuant to section 45-501 et seq., R.C.M. 1947. This lien foreclosure action resulted. Plaintiff joined George J. Stublar, the mortgagee of said property; Thomas C. Haggerty and John Gardner, d/b/a Gardner Construction, lienholders, as defendants in this action in addition to the homeowners. The contractor, Component Development Production Corporation was joined as third-party defendant.
Following trial on this foreclosure action, the district court made findings of fact, conclusions of law and granted judgment in favor of the homeowners. The basis of the district court's action was that there was no contract, express or implied, nor any consensual or contractual authority *1170 running from the homeowners to the electrical subcontractor upon which to base a mechanic's lien. In addition, the court concluded that the subcontractor was not entitled to a lien because it wilfully and voluntarily abandoned its work before there had been substantial performance of its agreement with the contractor. This appeal by the subcontractor followed.
The underlying issue upon appeal is whether under the facts the subcontractor has a valid lien against the homeowner. We answer in the negative.
The controlling statute is section 45-501, R.C.M. 1947, which provides in pertinent part:
"Every mechanic, miner, machinist, architect, foreman, engineer, builder, lumberman, artisan, workman, laborer, and any other person, performing any work and labor upon, or furnishing any material, machinery, or fixture for, any building * * * upon complying with the provisions of this chapter, for his work or labor done, or material, machinery or fixtures furnished, has a lien upon the property upon which the work or labor is done or material is furnished."
Plaintiff disputes the district court's conclusion of law on the basis that section 45-501, R.C.M. 1947, does not require a contract to create a mechanic's lien. It contends that all that is required is the performance of labor or the furnishing of materials. The lien is created by an implied agency vested in the general contractor. Green Plbg. & Heating Co. v. Morris, 144 Mont. 234, 395 P.2d 252; Merrigan v. English, 9 Mont. 113, 22 P. 454.
As pointed out in Glacier State Electric Supply v. Hoyt, 152 Mont. 415, 451 P.2d 90, there is an implied agency vested in the general contractor. This does not abrogate, however, the necessity of the requirement that in addition to furnishing materials and labor, there must be a contract, express or implied, by the owner of the property before there can be a valid lien. See also Dewey Lumber Co. v. McQuirk, 96 Mont. 294, 30 P.2d 475.
The subcontractor further argues that although substantial performance is necessary, there is an exception which allows a lien to a subcontractor who has failed to complete the work because of the prime contractor's failure to pay. 57 C.J.S. Mechanic's Liens § 113b. It is the homeowners' position, on the other hand, that one cannot successfully assert a mechanic's lien upon property where there has only been part performance or a lack of substantial performance of the work for which the party claims the lien. 53 Am.Jur.2d, Mechanic's Liens, § 51; Fidelity Savings & L. Ass'n of Port Arthur v. Baldwin, 416 S.W.2d 482 (Tex.Civ.App. 1967).
"Where there has been only a part performance of the contract by a materialman, it seems clear that he cannot assert a mechanic's lien for the materials furnished." 53 Am.Jur.2d, Mechanic's Liens, § 51.
Under certain circumstances the materialman may be granted a lien under the exception to the general rule that the contracted work must be completed. In those instances, however, it is usually the case where the materialman has substantially completed his work; or that he was prevented from completing his work by the breach of the owner or a third party. Fontaine v. Storrie, 7 Cal. App.2d 104, 45 P.2d 361; Greenberg v. Marsh, 101 Misc. 18, 167 N.Y.S. 102, aff'd. 184 App.Div. 890, 170 N.Y.S. 1083. For the subcontractor to fall within the exception it must prove that the contractor's failure to pay was a substantial breach of the contract preventing completion of the work.
The rule as to breach of contract is stated in Corbin on Contracts, § 946, as follows:
"The non-payment of an installment of money when due will always create a right of action for that money, but it will not always be a total breach."
*1171 This Court said in Gramm v. Insurance Unlimited, 141 Mont. 456, 461, 378 P.2d 662, 664:
"* * * it depends upon the particular facts of each case whether or not nonpayment of an installment is a total breach enabling the contractor to cease work, or whether it is merely a partial breach entitling the contractor to sue for the partial breach, but not permitting him to abandon the contract."
In Gramm this Court affirmed the district court's finding of a total breach entitling the contractor to a lien where prompt payment by the owner and time was of the essence. Unlike Gramm, there is nothing in the record to suggest that the contractor's failure to pay actually prevented the subcontractor from completing the work. In fact there is no evidence to indicate that the subcontractor was entitled to or had any right to demand any money from the contractor on the first of February when it submitted the bill to the contractor. Nor was there any proof that prompt payment by the contractor and time was of the essence to completion of the work.
The subcontractor's employee testified that he sent a billing for materials and labor to the contractor on the first of February. No such bill, however, was ever sent to the homeowners although he knew who the house was being constructed for. When the contractor did not come forth with the money, the subcontractor did not go to the homeowners and ask them for payment of the bill, nor did he ever ask them if they wanted the electrical work completed. Instead, he voluntarily removed all tools from the premises, leaving behind materials delivered, and abandoned his work  40% completed.
This Court, in Fausett v. Blanchard, 154 Mont. 301, 305, 463 P.2d 319, in affirming a judgment foreclosing certain liens on mining claims, stated:
"In reviewing equity cases, although all evidence is examined, the trial court will not be reversed if there is substantial evidence which would justify an inference supporting the judgments." (Citations omitted.)
There is substantial evidence in the present case to support the district court's judgment denying a mechanic's lien to the subcontractor for the reason that the subcontractor wilfully and voluntarily abandoned the installation of electrical services before there had been substantial performance of its agreement with the contractor.
We affirm the judgment of the district court.
JAMES T. HARRISON, C.J., and DALY, CASTLES and JOHN C. HARRISON, JJ., concur.
