
115 Ill.2d 119 (1986)
503 N.E.2d 233
W.E. ERICKSON CONSTRUCTION, INC., et al., Appellants and Cross-Appellees,
v.
CONGRESS-KENILWORTH CORPORATION et al., Appellees and Cross-Appellants.
Nos. 62000, 62001 cons.
Supreme Court of Illinois.
Opinion filed November 20, 1986.
Rehearing denied January 30, 1987.
*120 *121 *122 J. Samuel Tenenbaum and Alan E. Gitles, of Becker & Tenenbaum, of Chicago, for appellants and cross-appellees W.E. Erickson Construction, Inc., et al.
Nathan Diamond-Falk and Paul M. Daugerdas, of Chicago, for appellees and cross-appellants Congress-Kenilworth Corporation et al.
Judgment affirmed; cause remanded.
CHIEF JUSTICE CLARK delivered the opinion of the court:
This appeal involves a suit for an alleged breach of a construction contract. W.E. Erickson Construction, Inc., and Wilbert E. Erickson (collectively referred to herein as Erickson), plaintiffs, brought a breach of contract action against the defendants, Congress-Kenilworth Corporation, James Adams and John Stafford (collectively referred to herein as Congress), to recover monies Erickson alleges are due under its contract to construct the "Thunder Mountain Rapids," a concrete waterslide in Crestwood, Illinois. Erickson also sought appointment of a receiver and equitable relief. Congress filed a counterclaim for damages due to alleged construction defects.
In the circuit court of Cook County, following a 22-day bench trial, a $202,000 judgment was entered in favor *123 of Erickson on count II of its third amended complaint for breach of contract. The other five counts of Erickson's complaint and Congress' counterclaim were dismissed. Congress was awarded attorney fees from a fund held by the receiver who was appointed at Erickson's request at a pretrial hearing.
Both Erickson and Congress appealed to the appellate court. Erickson appealed from the award of damages, the dismissal of the remaining five counts of its amended complaint and the award of attorney fees to Congress. Congress filed a notice of appeal but did not pursue its appeal. 132 Ill. App.3d 260.
An earlier appeal in the appellate court involved these same parties on the issue of whether a receiver should have been appointed. In that appeal, the appellate court reversed the circuit court's order appointing a receiver. See W.E. Erickson Construction, Inc. v. Congress-Kenilworth Corp. (1983), 112 Ill. App.3d 847.
In the appellate court, in the appeal which is now before us, the appellate court held that although Erickson had substantially performed under the contract, the "trial court's award was not a proper method of computation of damages under the doctrine of substantial performance." (132 Ill. App.3d 260, 266.) The appellate court therefore vacated the judgment as to damages and remanded the cause for a recalculation of damages. The appellate court also held that Erickson was not entitled to interest because of Erickson's failure to comply with the contract provision requiring Erickson to make written application for monthly progress payments. The appellate court reasoned that since the right to interest was predicated on the submission of an application and Erickson failed to properly apply, interest was not due. 132 Ill. App.3d 260, 266.
Erickson had also proceeded in the appellate court on an alternative ground for recovery  an account stated. *124 The basis of the account-stated theory of recovery was a letter Congress' attorney had sent to Erickson allegedly acknowledging an indebtedness of $550,000. The appellate court held that the facts did not establish an account stated. 132 Ill. App.3d 260, 268.
Erickson also argued the theory of accord and satisfaction in the appellate court, but the court again found that there was not sufficient evidence to establish an accord and satisfaction. 132 Ill. App.3d 260, 269.
Erickson also maintained in the appellate court that the circuit court erred in denying Erickson's request for an equitable lien upon the waterslide and its proceeds. The appellate court held the Erickson was entitled to an equitable lien on the premises for the reasonable value of the permanent improvements Erickson placed on the premises because Erickson and Congress made a mutual mistake about the validity of a warranty deed which Erickson received from Congress as security for additional financing of the improvements. 132 Ill. App.3d 260, 270.
Lastly, Erickson argued that Congress was not entitled to the award of attorney fees out of the receivership fund because the receiver should only pay attorney fees for activities which benefit the receiver or protect and preserve the receivership fund. Erickson argued that Congress' contest of the receivership did not benefit the corporation. The appellate court rejected this argument and held that the attorney fees were properly awarded to Congress. The appellate court also held that the award of attorney fees to Congress would not be affected by the existence of Erickson's equitable lien. 132 Ill. App.3d 260, 272.
Both parties filed petitions for leave to appeal in this court (94 Ill.2d R. 315), and we have granted their petitions and consolidated the cause.
The appellate court opinion sets forth the relevant *125 facts, and those facts will be restated only to the extent necessary to resolve the issues the parties have raised in this appeal.
Erickson entered into a contract with Congress for the construction of a concrete water slide. The total cost for the slide was not to exceed $535,000, exclusive of specified costs and interest. According to the contract, Erickson, as the general contractor, was to be paid the cost of the work performed by the subcontractors and a contractor's fee of 15% of the project cost, exclusive of concrete, carpentry, architectural and engineering costs, Erickson's labor for concrete and carpentry work, and overhead, as well as additional amounts attributable to the costs of extra or modified work, permits, engineering fees, certain sewer and sanitary work, and interest at the rate of 2% over prime for overdue balances. Construction of the slide began on April 15, 1981, and the slide was completed on July 3, 1981, the day before the projected opening date. According to the record, Erickson has received $150,000 on the contract to date.
In count II of its amended complaint for breach of contract, Erickson sought damages in the amount of $550,000 for full performance under the contract. The trial court awarded $352,000, less the $150,000 already paid to Erickson, for a judgment of $202,000.
On appeal before this court, Erickson raises three main issues. The first issue is whether Erickson is entitled to interest on the alleged unpaid contract balance at the rate of 2% over the prime rate since June 20, 1981, the date Erickson alleges that Congress acknowledged its debt and waived its requirement that Erickson submit a final bill.
Second, Erickson argues that the cause should not be remanded for a reassessment of damages. Although Erickson believes it is entitled to substantially more than it was awarded in the trial court, it does not agree that *126 a remand is necessary. Erickson believes this court should increase the damage award without remanding the cause.
The third issue involves the award of attorney fees to Congress out of funds which Erickson argues were subject to Erickson's equitable lien.
In its brief, Congress, as cross-appellant, argues that the appellate court erred in finding that Erickson had substantially performed. Congress further argues that the amount of the judgment was proper, even if the appellate court correctly found substantial performance. Lastly, Congress argues that the appellate court erred in denying it a setoff of $67,587.26 as damages for the alleged wrongful appointment of a receiver.
Since Congress argues that Erickson did not substantially perform under the terms of the parties' construction contract, we must necessarily resolve this issue before deciding the tangential issues raised regarding the trial court's calculation of damages and whether Erickson is entitled to interest.
"The question of whether there has been substantial performance of the terms and conditions of a contract sufficient to justify a judgment in favor of the builder for the contract price is always a question of fact." Petersen v. Hubschman Construction Co. (1979), 76 Ill.2d 31, 44.
In People ex rel. Peterson v. Omen (1919), 290 Ill. 59, this court stated:
"Substantial performance of a contract means performance in all the essential elements necessary to the accomplishment of the purpose of the contract. [Citation.] `Substantial' means in substance; in the main; essential, including material or essential parts. [Citation.] It has been said by this court that `in building contracts a literal compliance with the specifications is not necessary to a recovery by the contractor. A substantial performance in *127 good faith is sufficient.'" 290 Ill. 59, 65-66.)
As the appellate court stated, a purchaser who receives substantial performance of a building contract must pay the price bargained for, less an offset for defects in what he received as compared to what strict performance would have given him. (Park v. Sohn (1982), 89 Ill.2d 453, 464-65.) On appeal, since the issue of whether there was substantial performance is a question of fact, the trial court's finding will not be disturbed unless it is against the manifest weight of the evidence. Schulenburg v. Signatrol, Inc. (1967), 37 Ill.2d 352, 356.
We agree with the appellate court that the trial court did find that Erickson substantially performed under the contract and that the trial court's finding is not against the manifest weight of the evidence. The trial court entered a judgment for Erickson on count II of its complaint for breach of contract. Count II sought damages in the amount of $550,000 for Erickson's full performance under the contract.
The trial court found that Erickson's selection of architects and the process it used to select subcontractors did not literally comply with the contract. However, the trial court also found that the defects in the slide were not severe enough to support a finding that Erickson performed in a wholly unworkmanlike manner. As we stated earlier, substantial performance means performance in all the essential elements necessary to accomplish the purpose of the contract. In this instance, the purpose of the contract was to build a concrete waterslide for recreational purposes. According to the record, the slide was completed on time and has served the purpose for which it was intended since its opening. While there was conflicting testimony presented as to whether the cracks in the concrete flumes of the slide were beyond acceptable limits, it was clear from the evidence *128 that the cracks have not interfered with the operation of the structure in its intended use. We therefore conclude that the trial court's finding of substantial performance is not against the manifest weight of the evidence.
The next issue we will address is the trial court's assessment of damages. The appellate court held that the trial court did not apply the standard of substantial performance in assessing Erickson's damages under the contract. (132 Ill. App.3d 260, 265.) The appellate court reasoned that the amount awarded only compensated Erickson for its out-of-pocket expenses in subcontractor labor and materials. The appellate court therefore vacated the judgment as to damages and remanded the cause for a recalculation of damages. In this court, as stated previously, although Erickson disagrees with the amount of its award, Erickson does not believe the cause should be remanded. Instead, Erickson argues that this court should reassess the damages and increase the damage award without remanding the cause. Congress argues that if we were to find that Erickson substantially performed, as we have, the amount of damages awarded would still be proper.
The record is unclear as to the actual contract cost. As Congress points out, Erickson has indicated various amounts due under the contract. We agree with the appellate court that it is necessary to remand this cause for a reassessment of damages since there are many conflicting costs alleged. Since we have determined that Erickson has substantially performed, the trial court is directed to recalculate the damages, considering any evidence it finds necessary to determine Erickson's damages on the basis of substantial performance.
Erickson also maintains in this appeal that it should be awarded interest at a rate of 2% over the prime rate for the balance due under the contract. The trial court *129 held that, because Erickson never tendered a 30-day itemized statement to Congress as required by the contract, Erickson forfeited any claim for interest due since June 1981. The appellate court held that the trial court's finding that Erickson failed to comply with the contract, and thus forfeited any right to interest, was not against the manifest weight of the evidence.
According to article 13 of the contract entered into between the parties, Erickson was obligated to apply for payment "at least ten days before each payment falls due * * *, showing in complete detail all the moneys paid out or costs incurred by him on account of the Cost of Work during the previous month for which he is to be reimbursed." It is clear that Erickson was required to make detailed written applications for monthly progress payments. Congress was then obligated to pay the amount due within 30 days of the application according to article 14 of the contract. Erickson did not submit anything resembling an application until June 16, 1981, two months after construction of the slide had begun. At that point, the project was 60% completed and the alleged application was for $246,958. The trial court found that the only written "application" for payment was a document written by Erickson so that a loan could be obtained, and there was no testimony that the application was ever intended to actually be an application for payment. The appellate court held, and we agree, that the contract specifically predicated payment and interest on the submission of a timely application. Erickson failed to comply with the terms of the contract, and therefore no interest is due.
We also agree with the appellate court that simply because Congress has paid Erickson some money on the contract does not mean Congress waived the requirement of an application for payment.
Erickson, in its brief before this court, also asserts *130 that it is entitled to interest because Congress "acknowledged" its debt to Erickson. Erickson argues that because Congress passed a corporate resolution deeding the land that the waterslide occupies to Erickson, and Congress' attorney sent a letter stating that Congress was indebted to Erickson, Erickson is entitled to the full contract price and interest.
Erickson argues in its brief that it should recover the full contract price and should receive interest on an account-stated theory. We agree with the appellate court that the evidence presented is not sufficient to establish an account stated. As the appellate court stated, "[t]he meeting of the minds upon the correctness of an account is usually the result of one party's rendering a statement of account to which the other party acquiesces." (132 Ill. App.3d 260, 267, citing La Grange Metal Products v. Pettibone Mulliken Corp. (1982), 106 Ill. App.3d 1046, 1053, and Motive Parts Co. of America, Inc. v. Robinson (1977), 53 Ill. App.3d 935, 938.) Neither passing the resolution deeding the land nor the letter Congress' attorney sent to Erickson was intended to be a statement of account. The testimony given indicates that both were intended to secure financing, and not as statements of account. Therefore, we do not agree with Erickson that it is entitled to the contract price and interest on that basis.
The last issue raised in this court by Erickson involves the trial court's award of $16,412 in attorney fees to Congress out of the receivership fund. Erickson requested the trial court to appoint a receiver over Congress' assets in May of 1981. Although Congress opposed the appointment, a receiver was appointed. Then, in February of 1982, the appellate court reversed the appointment of the receiver. (W.E. Erickson Construction, Inc. v. Congress-Kenilworth Corp. (1983), 112 Ill. App.3d 847.) The trial court then awarded Congress attorney *131 fees incurred to contest the receivership. The appellate court held that Congress "had both the right and the duty to repel an attack upon its corporate existence it regarded as unfounded, [and therefore] it was entitled to recover enough of its own assets to pay the expenses of its defense." (132 Ill. App.3d 260, 272.) The appellate court held that the award of attorney fees out of the receiver's fund was proper.
Erickson argues in this court that Congress should not have been awarded attorney fees because the actions of Congress "were solely for their benefit and in no way benefited the receivership." This argument is illogical. The opposition to the appointment of the receiver, which is what the attorney fees were charged for, was successful. The contest benefitted the corporation, because it was its assets which were the subject of the receivership. We agree with the appellate court that Congress was entitled to recover enough of its own assets to pay the expenses of its defense.
In People ex rel. Schacht v. Main Insurance Co. (1983), 114 Ill. App.3d 334, one of the issues addressed was whether a trial court has the power to award attorney fees incurred in good faith to contest the appointment of a receiver. The court held:
"It is well established that as a general rule where an application has been made for the appointment of a receiver for a corporation, attorney fees and expenses, if incurred in good faith, may become a valid claim against the receiver, such claim being addressed to the sound discretion of the trial court. [Citations.]" 114 Ill. App.3d 334, 338.
Erickson argues that the case quoted above was "erroneously relied upon" by the appellate court "because it involved an action under the insurance code; the award of fees was to attorneys appointed by the rehabilitator and the attorneys' duties concerned the existence of the corporation rather than the ownership of certain funds." *132 However, the fact that the case in which this rule is stated involved the Insurance Code does not mean that the rule is not applicable in a case like the instant one. In Assets Realization Co. v. DeFrees (1907), 225 Ill. 508, the same principle was enunciated. In that case, the issue was whether the corporation should be awarded fees for protesting the appointment of a receiver. In Assets, a case not dealing with the Insurance Code, this court held that "the representatives of corporations whose very existence is attacked should be afforded reasonable means for resisting such attack, if the facts appear to justify such resistance." 225 Ill. 508, 513.) In the instant case, since we believe the resistance to the appointment was justified, and since Congress was successful on appeal to the appellate court, we agree that the award of attorney fees to Congress was proper.
On a related point, Erickson alleged in the appellate court not only that its request for an equitable lien should have been allowed, but also that its lien should have taken priority over the circuit court's award of attorney fees to Congress. The appellate court held that no prejudice to Erickson resulted because the payment of attorney fees, as part of the cost of the receivership, had priority and would not therefore be affected by Erickson's equitable lien. (132 Ill. App.3d 260, 272.) Erickson maintains in this court that its equitable lien arises out of work that was performed prior to the services performed by Congress' counsel and that therefore its lien has priority over the award of fees. Erickson further argues that the general rule  that a lien which is prior in time gives a prior claim and is entitled to satisfaction out of the subject matter it binds before other subsequent liens binding the same property  is applicable in this situation. The award of attorney fees by the circuit court preceded the subsequent finding by the appellate court that an equitable lien should have been imposed by *133 the circuit court, so Erickson's argument regarding the priority of its equitable lien based on when the work giving rise to the lien was performed is irrelevant. The award of attorney fees preceded Erickson's equitable lien so the award of attorney fees was actually prior in time. Erickson's argument is without merit.
Since all but one of the issues Congress has raised in its cross-appeal have been decided in the resolution of the issues raised by Erickson, we will address the remaining issue Congress raised: whether it is entitled to a setoff of $67,587.26 as damages for the wrongful appointment of a receiver.
Erickson alleges that Congress is not entitled to a setoff for the costs and expenses for the wrongful appointment of a receiver because it failed to raise this issue in its petition for leave to appeal in this court.
On September 23, 1983, Congress filed a motion in the trial court to modify the judgment rendered for Erickson to include a setoff for the costs and expenses it incurred as a result of the wrongful appointment of the receiver. According to Congress, before it received a decision on its motion, it appealed the trial court's order appointing the receiver to the appellate court and that order was reversed. The trial court then denied the motion for the costs and expenses on the basis that it was without jurisdiction to hear the motion due to an intervening notice of appeal filed by Congress. Congress then filed a motion for a hearing and other relief in the appellate court. The motion was denied. Congress did not appeal this order. Instead, on January 4, 1984, Congress filed a new suit in the chancery division, which was transferred to the law division, again asking for the costs and expenses for the wrongful appointment of the receiver. On March 4, 1986, the trial court granted Erickson's motion to dismiss this suit. Congress then filed a notice of appeal. Since Congress was filing its *134 brief in this court on April 7, 1986, it raised this issue in its brief. In the interest of judicial economy, we will address this issue in this court.
As a rule, where the appointment of a receiver is improperly procured, the costs and expenses of the receivership are allocated to the party who procured the appointment. (Corcoran v. Witz (1929), 252 Ill. App. 473, 475; Hughes v. Link Belt Machinery Co. (1901), 95 Ill. App. 323, 330, aff'd (1902), 195 Ill. 413; Myres v. Frankenthal (1894), 55 Ill. App. 390, 396.) We believe that Congress is entitled to a setoff against the judgment which will be entered for Erickson. In its brief, Congress alleges that the costs and expenses it incurred as a result of the wrongful appointment of the receiver are $67,587.26. It further states that the figures are all the subject of trial court orders and therefore not subject to dispute. Erickson disagrees with the $67,587.26 figure and alleges in its reply brief that because certain fees were incurred at Congress' request they are not properly "costs of the receivership." Erickson also alleges that Adams, one of the defendants, received a salary for operating the waterslide and that his salary cannot properly be considered a cost of the receivership.
Since there is a disagreement between the parties as to which costs are properly considered the costs of the receivership, we are also remanding this matter to the circuit court for a hearing to determine the proper costs of the receivership in accordance with our holding that Congress is entitled to a setoff against the judgment for Erickson.
There are three motions which we have taken with this case. The motions are ruled upon by an order outside the perimeters of this opinion.
Accordingly, we affirm the appellate court judgment which holds that Erickson substantially performed and remand the cause to the circuit court for a recalculation *135 of damages based on Erickson's substantial performance. We also affirm the judgment of the appellate court denying the payment of interest to Erickson and awarding Congress attorney fees. We allow Congress' request in this court for the costs and expenses arising from the appointment of the receiver and remand for a calculation of the proper setoff.
Judgment affirmed; cause remanded, with directions.
