
144 Ill. App.3d 651 (1986)
494 N.E.2d 592
THE VILLAGE OF ROSEMONT, Plaintiff-Appellant,
v.
LENTIN LUMBER COMPANY et al., Defendants-Appellees.  THE VILLAGE OF ROSEMONT, Plaintiff-Appellant,
v.
LENTIN LUMBER COMPANY et al., Defendants-Appellees.  THE VILLAGE OF ROSEMONT, Plaintiff-Appellant,
v.
WEYERHAEUSER COMPANY, Defendant-Appellee.
Nos. 84-2159, 84-2769, 84-3028, 85-1146 cons.
Illinois Appellate Court  First District (2nd Division).
Opinion filed May 20, 1986.
Rehearing denied June 24, 1986.
*652 *653 *654 *655 *656 Ancel, Glink, Diamond, Murphy & Cope, P.C., of Chicago (Peter M. Rosenthal, of counsel), for appellant.
Pretzel & Stouffer, Chartered, McNeela & Griffin, Ltd., Friedman & Koven, Baker & McKenzie, McDermott, Will & Emery, and Hinshaw, Culbertson, Moelmann, Hoban & Fuller, all of Chicago (Joseph B. Lederleitner, Samuel B. Isaacson, Francis D. Morrissey, John T. Coleman, Gary W. Fresen, Corinne A. Seither, Gary L. Prior, Stephen P. Krchma, D. Kendall Griffith, Charles H. Cole, H. Anne McKee, and Joshua G. Vincent, of counsel), for appellees.
Judgment affirmed.
JUSTICE STAMOS delivered the opinion of the court:
Four appeals here consolidated for hearing arise from three lawsuits involving the collapse of a portion of the roof of the Rosemont Horizon Arena during the course of its construction. The plaintiff, the village of Rosemont, owner of the Arena, sought recovery in tort from the contractor, Lentin Lumber Company, from a subcontractor, CST Construction Company, and from a subcontractor for the drawings of the roof, Enterprise Engineering Corporation. The village also sued Lentin for breach of contract and sued Heritage Insurance Company of America and National Bonding and Accident Insurance Company, the sureties for Lentin and CST, for a breach of performance bond. Case number 84-2159 is an appeal from summary judgment and other rulings entered in favor of Lentin, CST, and Enterprise. Case number 84-3028 is an appeal from the subsequent entry of summary judgment for the two sureties. In another complaint, the village alleged products liability and breach of warranty against the Weyerhaeuser Company, the manufacturer of the roofing beams. Case number 85-1146 is an appeal from summary judgment of the trial court in favor of Weyerhaeuser. In a third lawsuit the village sued Lentin, CST and Enterprise under theories of products liability and warranty, and alleged defendant's conduct was wilful and wanton. Case number 84-2769 appeals from the trial court's dismissal of the complaint with prejudice.
On August 21, 1978, plaintiff entered into a construction contract with Lentin on the standard form of agreement provided by the American Institute of Architects. Lentin was to provide for the design, fabrication and erection of the roof structure of the Rosemont Horizon Arena. Lentin was the local distributor for Weyerhaeuser Company, which manufactured and supplied the roofing beams for the project. Lentin hired CST as a subcontractor to erect the roof structure and hired Enterprise as a subcontractor to prepare laminated *657 wood roof framing shop drawings. Design responsibility for these drawings was on the village's architect or engineer, who each approved the drawings. Lentin secured the performance of its contract with plaintiff by a performance bond which was executed by Lentin as principal and Heritage as surety, and which named plaintiff as obligee. CST and National also executed a performance bond naming Lentin and plaintiff as obligees.
Subparagraph 11.3.1 of Lentin's contract with plaintiff required plaintiff to "purchase and maintain property insurance upon the entire work at the site to the full insurable value thereof." The insurance was to include the interests of plaintiff, Lentin, and all subcontractors and sub-subcontractors in the work. The policy purchased was to insure against fire and extended coverage and was to include all-risk insurance for physical loss or damage. Subparagraph 11.3.6 of the contract provided that "the Owner and Contractor waive all rights against (1) each other and the Subcontractors * * * for damages caused by fire or other perils to the extent covered by insurance obtained pursuant to this Paragraph 11.3 or any other property insurance applicable to the Work * * *."
Plaintiff purchased a special multiperil or builders' risk policy covering building property on the project to $6 million. On August 13, 1979, the roof of the Arena collapsed while the Arena was still under construction. Plaintiff recovered $1.5 million from the multiperil policy and sued Lentin, CST and Enterprise for an additional $5 million.
Lentin filed a motion for summary judgment contending that under the terms of the contract, plaintiff had waived its claims for physical damage to the work and had agreed to shift the risk of loss to insurance it had agreed to procure. CST joined in and adopted Lentin's motion. Enterprise also filed a motion for summary judgment asserting the same waiver that had been raised by Lentin. Enterprise also argued that plaintiff could not recover economic damages in tort and that Enterprise's acts or omissions were not the cause of the collapse of the roof. Plaintiff responded to the motions and submitted an affidavit which demonstrated that its recovery under the insurance policy purchased did not cover damages caused by the roof's collapse.
The trial court entered an order on January 12, 1984, granting summary judgment in favor of Lentin and Enterprise, finding that pursuant to subparagraphs 11.3.1 and 11.3.6 of the Lentin/plaintiff contract, plaintiff had waived all claims for physical loss or damage to the work and that those provisions were unambiguous. The court set the matter for a status hearing as to what claims, if any, remained against defendants. On June 19, 1984, the court entered summary *658 judgment in favor of Lentin, Enterprise and CST, found that the judgment disposed of all claims alleged against defendants and denied plaintiff's motion to reconsider its earlier order. On August 2, 1984, the court made the summary judgment order final and appealable and denied plaintiff's motion for leave to file an amended complaint adding claims against Lentin for breach of warranty and strict liability in tort, and against both Lentin and CST for wilful and wanton misconduct. Eleven days later, the court dismissed with prejudice on grounds of res judicata a complaint plaintiff filed which was identical to the amended complaint the court had previously denied plaintiff leave to file.
National then moved for summary judgment asserting that its liability was coexistent with that of CST, its principal, and that it was entitled to summary judgment because CST's motion for summary judgment had been granted. Heritage later joined this motion on behalf of its principal, Lentin. The court entered an order granting the motion.
Subsequently, the trial court entered an order granting summary judgment in favor of Weyerhaeuser Company, whose roofing beams plaintiff had alleged were unmerchantable, defective and unreasonably dangerous. Weyerhaeuser maintained in its motion that article 20 of its August 21, 1978, American Institute of Architects standard form construction contract with plaintiff was similar to the provisions found in the contract between plaintiff and Lentin. Paragraph 20.1 provided that plaintiff was to "purchase and maintain property insurance upon the entire Work at the site to the full insurable value thereof." The insurance was to include the interests of Weyerhaeuser and was to insure against the perils of "Fire, Extended Coverage, Vandalism and Malicious Mischief." Paragraph 20.4 stated that plaintiff and Weyerhaeuser "waive all rights against each other for damages caused by fire or other perils to the extent covered by insurance provided under this paragraph." In granting summary judgment, the court expressly found that there was no material issue of fact concerning article 20, that the contract was not ambiguous, and that plaintiff had waived all of its claims against Weyerhaeuser.
Plaintiff first contends that the trial court erred in determining that in its contracts the village, waived all claims, other than mechanics' liens, against Lentin, CST, Enterprise, and Weyerhaeuser. Plaintiff asserts that defendants failed to establish they were entitled to summary judgment as a matter of law, that the trial court failed to construe the contracts as a whole and that no factual or legal authority supports finding that the waiver provisions of the Lentin contract *659 subparagraph 11.3.6 and the Weyerhaeuser contract paragraph 20.4 are unlimited.
 1-3 Summary judgment is properly granted where the pleadings and other evidence raise no triable issue of material fact and where movant is entitled to judgment as a matter of law. (Aspegren v. Howmedica, Inc. (1984), 129 Ill. App.3d 402, 404, 472 N.E.2d 822.) Summary judgment is an appropriate procedure in construing the legal principles of a contract. (Ervin v. Sears, Roebuck & Co. (1984), 127 Ill. App.3d 982, 990, 469 N.E.2d 243.) Contracts must be interpreted as a whole, and it is presumed that all provisions were inserted for a purpose. (Bruno Benedetti & Sons, Inc. v. O'Malley (1984), 124 Ill. App.3d 500, 506, 464 N.E.2d 292.) A court has a duty to harmonize the provisions of a contract (In re Support of Halas (1984), 104 Ill.2d 83, 92, 470 N.E.2d 960) and to avoid construction which renders some provisions meaningless (Lukasik v. Riddell, Inc. (1983), 116 Ill. App.3d 339, 347, 452 N.E.2d 55). Applying these principles to the case at bar leads to the conclusion that summary judgment was properly entered against the plaintiff.
 4 In ruling that there was no material issue of fact concerning contracts between plaintiff and Lentin and plaintiff and Weyerhaeuser, the court reviewed the contracts' provisions and determined that the plaintiff had clearly and unambiguously waived all claims against these defendants and the subcontractors CST and Enterprise. The previously cited subparagraphs 11.3.1 and 11.3.6 of the Lentin contract and paragraphs 20.1 and 20.4 of the Weyerhaeuser contract pertain to plaintiff's obligation to purchase extended coverage insurance covering the entire work at the Arena to its full insurable value, and to plaintiff's waiver of all claims against defendants for physical loss or damage to the work. According to these provisions, it is clear that the parties mutually agreed that insurance alone would provide recovery for any property loss or damage to the work. The parties specifically agreed that the responsibility for obtaining that insurance was plaintiff's and that the type of insurance to be purchased was to include all-risk coverage. While we have found no Illinois case directly on point, such agreements have been construed in other jurisdictions as evidence that the parties intended to exculpate each other from personal liability in the event of property loss, and that they intended to look to insurance to pay for such loss. Tuxedo Plumbing & Heating Co. v. Lie-Nielsen (1980), 245 Ga. 27, 262 S.E.2d 794; Baugh-Belarde Construction Co. v. College Utilities Corp. (Alas. 1977), 561 P.2d 1211; South Tippecanoe School Building Corp. v. Shambaugh & Son, Inc. (1979), 182 Ind. App. 350, 395 N.E.2d 320.
*660 It is true that these cases have involved subrogation claims brought by the builder's risk insurer. Thus, the insurer has been denied recovery on the grounds that, under the construction contract, the contractor or subcontractor has been a co-insured under the owner's builder's risk policy. Absent fraud or design, a builder's risk insurer is not entitled to subrogate against one whose interests are insured. (South Tippecanoe School Building v. Shambaugh & Son, Inc. (1979), 182 Ind. App. 350, 363, 395 N.E.2d 320.) However, we believe that the cases are instructive in the instant situation where the plaintiff owner, not the insurer, seeks recovery from defendant builders despite the parties' express contracts that plaintiff would insure against property damage to the work and that it would have no right of action against defendants for any such damage.
For instance, in Tuxedo Plumbing & Heating Co. v. Lie-Nielsen (1980), 245 Ga. 27, 262 S.E.2d 794, the Georgia Supreme Court reviewed the meaning and enforceability of contract provisions similar to those at bar. There, an owner of apartments and a plumbing contractor had agreed that "Owner shall be responsible for procuring and maintaining fire insurance with extended coverage upon the * * * Property." 245 Ga. 27, 27, 262 S.E.2d 794, 795. After a fire allegedly caused by the contractor's negligence, the owner contended the insurance was to cover the owner alone. The court disagreed, stating that the owner could not recover from the contractor "for liability he had agreed to cover with insurance * * * [T]he insurance clause shifts the risk of loss to the insurance company regardless of which party is at fault." 245 Ga. 27, 29, 262 S.E.2d 794, 795.
Likewise, in South Tippecanoe School Building Corp. v. Shambaugh & Son, Inc. (1979), 182 Ind. App. 350, 395 N.E.2d 320, an action was brought against a contractor and subcontractor whose negligence allegedly caused a gas explosion and fire during construction of a school. In reviewing the trial court's order granting summary judgment for defendant contractors and subcontractors, the court of appeals of Indiana construed contract clauses virtually identical to those within the agreements here in dispute. The court found that such provisions reflected a studied attempt by the parties to cover the construction risks by insurance and to allocate the burden of procuring the insurance. (182 Ind. App. 350, 360, 395 N.E.2d 320, 326.) The court read the property insurance provision along with the waiver provisions and found that the insurance proceeds were intended by the parties to be the exclusive source of redress for damages to the property. Therefore, "the parties were to be limited in recovery for property damage to the proceeds of the insurance required to be carried *661 under the contract, rather than to the individual assets of a negligent Defendant." 182 Ind. App. 350, 362-63, 395 N.E.2d 320, 327-28.
We have previously construed a waiver provision such as the one here on appeal as a proper agreement between the parties to assume the risk of loss "as between themselves due to fire or other perils, to the extent * * * covered by insurance." (Ralph Korte Construction Co. v. Springfield Mechanical Co. (1977), 54 Ill. App.3d 445, 447, 369 N.E.2d 561.) We find that the instant contracts evidence that the parties foresaw the potential of property loss occurring through negligence or accident during construction of the roof at the Arena. The agreements expressly impose on plaintiff the duty to insure against loss to the full insurable value of the entire work. The extended coverage purchased is to include the interests of the parties to the contracts and their subcontractors and sub-subcontractors. Within the same property insurance article, the parties expressly waived all rights against each other for damages caused by perils covered under the policy. We believe it is clear that the parties intended to allocate property loss to an insurer and to limit the recourse of the plaintiff, the party acquiring the policy, solely to the insurance proceeds. Thus, the trial court properly entered summary judgment for defendants Lentin, Weyerhaeuser, and the subcontractor defendants Enterprise and CST.
The plaintiff contends that the trial court ignored contractor liability insurance and indemnification provisions in the contracts, and that these provisions conflict with the general conditions, Lentin subparagraphs 11.3.1, 11.3.6 and Weyerhaeuser paragraphs 20.1 and 20.4. The plaintiff argues that some of the "ignored" provisions were supplementary to the general conditions and that in cases of conflict, the supplementary conditions are to take precedence over the general conditions.
Regarding the Lentin contract, the sections plaintiff points to provide:
"General Conditions
11.1 CONTRACTOR'S LIABILITY INSURANCE.
11.1.1. The Contractor shall purchase and maintain such insurance as will protect him from claims set forth below which may arise out of or result from the Contractor's operations under the Contract, whether such operations be by himself or by any Subcontractor or by anyone directly or indirectly employed by any of them, or by anyone for whose acts any of them may be liable:
* * *

*662 .5. Claims for damages, other than to the work itself, because of injury to or destruction of tangible property, including loss of use resulting therefrom ...
* * *
4.18 INDEMNIFICATION
4.18.1. To the fullest extent permitted by law, the Contractor shall indemnify and hold harmless the Owner and the Architect and their agents and employees from and against all claims, damages, losses and expenses, including but not limited to attorneys' fees, arising out of or resulting from the performance of the Work, provided that any such claim, damage, loss or expenses (1) is attributable to bodily injury, sickness, disease or death, or to injury to or destruction of tangible property (other than the Work itself) including the loss of use resulting therefrom, and (2) is caused in whole or in part by any negligent act or omission of the Contractor, any Subcontractor, anyone directly or indirectly employed by any of them or anyone for whose acts any of them may be liable. Such obligation shall not be construed to negate, abridge, or otherwise reduce any other right or obligation of indemnity which would otherwise exist as to any party or person described in this Paragraph 4.18.
* * *
Supplementary Conditions
4.18.4. Contractor shall indemnify, keep and save harmless the Village of Rosemont, its agents, officials and employees, against all injuries, deaths, losses, damages, claims, patent claims, suits, liabilities, judgments, costs and expenses, (including any liability under the Illinois Structural Work Act, known as the Scaffolding Act), which may arise directly or indirectly from any negligence or from the reckless or wilful misconduct of the Contractor or his employees, or of the Subcontractor or his employees, if any, and the Contractor shall at his own expense, appear, defend and pay all charges of attorneys and all costs and other expenses arising therefrom or incurred in connection therewith, and, if any judgment shall be rendered against the Village of Rosemont in any such action, the Contractor shall, at his own expense, satisfy and discharge the same. Contractor expressly understands and agrees that any performance bond or insurance protection required by this contract, or otherwise provided by Contractor, shall in no way limit the responsibility to indemnify, keep and save harmless and defend the Village of Rosemont as herein provided."
*663  5 Although plaintiff is correct that if provisions within the contract conflict, supplementary conditions are to prevail over general conditions, we find that the trial court considered plaintiff's argument regarding the allegedly conflicting provisions, construed the contract as a whole, and correctly determined that no conflict exists. In the parties' overall scheme of allocating the burdens of acquiring various insurance, paragraph 11.1 requiring the contractor to carry liability insurance for claims other than to the work itself in no way conflicts with subparagraph 11.3.1 requiring plaintiff to purchase property insurance upon the entire work. Likewise, the indemnity clauses logically relate to the contractor's duty to protect plaintiff from liability for claims by third parties. The terms indemnification and guaranty are used synonomously. (Indemnity Insurance Co. of North America v. Prairie State Bank (1949), 336 Ill. App. 438, 84 N.E.2d 338.) An indemnity, like a guaranty, is a third party's promise to answer for payment of an obligation if the person primarily liable fails to make payment or fails to perform the obligation. (See Arco Petroleum Products Co. v. R & D Automotive, Inc. (1983), 118 Ill. App.3d 634, 455 N.E.2d 227.) The liability insurance and indemnification provisions, therefore, are entirely consistent with the explicit waiver of claims between the parties to the contract in subparagraph 11.3.6.
 6 In support of its contention that the trial court overlooked the indemnity provisions of the contract, plaintiff focuses on the last sentence of subparagraph 4.18.4. Plaintiff urges that the scope of subparagraph 4.18.4 is not limited by subparagraphs 11.3.1 and 11.3.6. We question this construction of the indemnification provisions, however, because it then becomes unclear when, if ever, the provisions of 11.3.1 and 11.3.6 operate. Moreover, plaintiff's interpretation overlooks the import of the words in subparagraph 4.18.4: "* * * Contractor * * * agrees that any * * * insurance protection required by this contract, or otherwise provided by Contractor, shall [not] limit the responsibility to indemnify." Clearly, subparagraph 4.18.4 looks primarily to the contractor's insurance, while subparagraph 11.3.6 looks to plaintiff's insurance.
It is axiomatic that a contract must be interpreted as a whole, with an effort toward giving effect to every provision in the contract. (La Throp v. Bell Federal Savings & Loan Association (1977), 68 Ill.2d 375, 381, 370 N.E.2d 188, cert. denied (1978), 436 U.S. 925, 56 L.Ed.2d 768, 98 S.Ct. 2818.) Harmonizing the various sections of the contract compels the conclusion that the provisions were intended to distribute different risks. Consequently, we find that the trial court examined the entire contract and correctly avoided a construction *664 which would have rendered any provision meaningless.
 7, 8 Plaintiff likewise argues that the trial court overlooked a Weyerhaeuser contract indemnity clause similar to the Lentin contract indemnity clause already discussed. We conclude that the trial court properly interpreted the Weyerhaeuser contract as a whole. Plaintiff also contends that Weyerhaeuser's obligation to remedy defects in the materials, equipment, or workmanship of the roofing beams and plaintiff's right to terminate the contract for defaults of Weyerhaeuser conflict with the property insurance and waiver provisions. However, the risks of defects in the work or of the contractor's default do not conflict with the risk of destruction to the work. We believe the parties' appropriate provision for such possibilities of lack of performance does not conflict with the property insurance and waiver provisions.
 9 Plaintiff also asserts that the trial court's ruling required it improperly to draw inferences concerning factual issues of the cause of the roof's collapse and the extent of plaintiff's insurance. To the contrary, the record reflects that the trial court stated that the issue to be decided was whether the scope of the contracts included insuring against loss from collapse of the roof. The court construed the contracts as a matter of law and found that the all-risk insurance required under the contracts covered the event of the roof's collapse. As a rule, recovery under an all-risk policy will be allowed for all fortuitous losses not resulting from misconduct or fraud; the collapse of a roof is literally within such coverage. (Missouri Commercial Investment Co. v. Employers Mutual Casualty Co. (Mo. App. 1984, 680 S.W.2d 397.) It neither made nor needed to make assumptions regarding the cause of the collapse or the extent of plaintiff's insurance.
 10 Plaintiff argues that the waiver provisions in the contracts could not encompass all claims. It alleges that the language in the contracts' provisions waiving rights to damage "to the extent covered by insurance" means such waivers extend only to the dollar amount of the policy obtained. We reject plaintiff's argument. As the trial court noted, this interpretation of the phrase renders the provisions illusory and could not be a rational allocation of risk to protect the parties' interests, since plaintiff would then totally control whether to buy insurance or not.
 11 Similarly, the plaintiff contends that it sustained damage to the bleachers and masonry exterior of the Arena when the roof collapsed and that, if the waiver provisions of the contract have any effect at all, they are limited to property damage in the erection of the roof and in the supplying of certain materials. We disagree, since paragraphs 11.3 of the Lentin contract and 20.1 of the Weyerhaeuser *665 contract require plaintiff to provide insurance covering the entire work at the site, and the waiver of claims in subparagraph 11.3.6 is based upon either insurance required by paragraph 11.3 or any other applicable insurance. The policy which plaintiff purchased was an all-risk policy which covered building at the Arena, roof and nonroof. (See E.C. Long, Inc. v. Brennan's of Atlanta, Inc. (1979), 148 Ga. App. 796, 252 S.E.2d 642.) Even as to defendant Weyerhaeuser, whose contract with plaintiff makes no mention of alternative applicable property insurance, we believe that damage covered at the site did not exist independently from the work defined in the contract, but arose from it. As the trial court correctly interpreted, the on-site damage or loss from the fortuitous collapse of the roof must "relate" to the contracted for work. Thus, the damage caused at the site nonroof portions of the Arena is covered under the contract waiver provision.
 12 The Lentin contract also covers plaintiff's claims of damage from delay in opening the Arena and of damage to its business reputation. Subparagraph 11.4.1 specially provides:
"The Owner, at his option may purchase and maintain such insurance as will insure him against loss of use of his property due to fire or other hazards, however caused. The Owner waives all rights of action against the Contractor for loss of use of his property, including consequential losses due to fire or other hazards, however caused, to the extent covered by insurance under this paragraph 11.4."
In construing the contract as a whole, the trial court properly found that consequential damages were accepted by plaintiff.
 13 Finally, plaintiff attempts to limit the effect of the waiver provisions by claiming that they cannot extend to claims for breach of contract, implied warranty or strict liability theories. The argument lacks merit. The parties agreed that any casualty loss would be borne solely by insurance purchased by plaintiff, and plaintiff expressly waived all claims against defendants arising from a loss covered by that insurance. In construing the scope of the waiver provision, it is clear that the determination must be whether there was a breach in performance of the contract in relation to the very thing covered by the exculpatory provisions. Since the collapse of the roof was related to performance on the contract, the occurrence, and loss and damage therefrom, are covered under the all-risk policy plaintiff was required to purchase. To the extent of this type of coverage, plaintiff and defendants mutually agreed to waive all rights against each other for damages. We conclude that the trial court did not err in granting *666 summary judgment as to Lentin, CST, Enterprise, and Weyerhaeuser.
 14, 15 Plaintiff's second major contention on appeal is that the trial court abused its discretion in denying plaintiff leave to file an amended complaint against Lentin, CST, and Enterprise. Plaintiff's right to amend his complaint is not absolute. (Lordahl v. Mauro (1982), 109 Ill. App.3d 478, 481, 440 N.E.2d 989.) While permission is to be liberally allowed, granting or denying leave to amend is within the discretion of the trial court. (109 Ill. App.3d 478, 481 440 N.E.2d 989.) A reviewing court will not disturb the trial court's ruling in this regard unless there is a clear abuse of that discretion, determined by whether allowing the proposed amendment furthers the ends of justice. (109 Ill. App.3d 478, 481, 440 N.E.2d 984.) However, before a trial court will be deemed to have abused its discretion, the materiality of the amendment must be apparent from the proceeding or apparent to the trial judge. Beatrice Foods Co. v. Illinois Insurance Guaranty Fund (1984), 122 Ill. App.3d 172, 175, 460 N.E.2d 908.
 16 Here, plaintiff sought to add new allegations of breach of implied warranties of merchantability and fitness of use and strict liability against Lentin, and a new claim of wilful and wanton misconduct against Lentin, CST, and Enterprise. We find that the trial court did not abuse its discretion in denying plaintiff leave to amend the complaint to add the new allegations based on warranty and strict liability. The trial court had already ruled that plaintiff had contractually waived all claims against Lentin, CST and Enterprise for loss or damage to the work. The proposed amendment, therefore, was not sufficient to avoid the effect of plaintiff's express waiver, and granting it would not have furthered the ends of justice. See Lordahl v. Mauro (1982), 109 Ill. App.3d 478, 440 N.E.2d 989.
 17 Neither did the trial court abuse its discretion in denying plaintiff leave to assert a claim of wilful and wanton misconduct against defendants Lentin, CST, and Enterprise. Despite the substantial amount of discovery already conducted in the case over a period of years, plaintiff offered the trial court no factual basis to support the new allegation. Under the circumstances of this case, we must conclude that plaintiff's conclusory pleading did not make the materiality of the amendment apparent to the trial court. Intini v. Schwartz (1979), 78 Ill. App.3d 575, 579, 397 N.E.2d 84.
 18 Plaintiff also urges that the trial court erred in dismissing with prejudice a complaint which was identical to the amended complaint the court had denied it leave to file. Plaintiff concedes that the new action arose out of the same incident and involved the same *667 claims against the same parties as it had attempted to raise in its amended complaint. It asserts, however, that the doctrine of res judicata should not bar the action because plaintiff was not afforded a full and fair opportunity to litigate its claims in the preceding action by virtue of the court's denial of leave to file the amended complaint. Plaintiff also contends that the case of Wiseman v. Law Research, Inc. (1971), 133 Ill. App.2d 790, 270 N.E.2d 77, calls for reexamination of the rule that a judgment of a trial court can be res judicata, even though that judgment is pending appeal. Neither of plaintiff's arguments are persuasive.
The record reflects that the trial court had before it plaintiff's motion for leave to amend with a memorandum in support and Lentin's response to the motion. It entertained a full hearing on the motion, and considered the merits of plaintiff's amended complaint. These ample opportunities to present reasons or facts which might have formed a basis for the proposed amendments provide no support for plaintiff's argument that it should be excused from the doctrine of res judicata because it was denied a full and fair opportunity to litigate. Further, the Wiseman opinion plaintiff relies on to challenge the wisdom of the majority rule that an appeal from a judgment does not suspend the effect of the judgment as res judicata between the parties, actually held that one should not be able to avoid the use of a judgment merely by taking an appeal. A decision rendered by a competent tribunal is presumed correct. (Jefferson County School District No. R-1 v. Industrial Com. (Colo. App. 1984), 698 P.2d 1350.) Res Judicata barred plaintiff's "new" action because a judgment was entered on the same cause of action against the same parties. (LaSalle National Bank v. County Board of School Trustees (1975), 61 Ill.2d 524, 528, 337 N.E.2d 19, cert. denied (1976), 425 U.S. 936, 48 L.Ed.2d 177, 96 S.Ct. 1668.) The trial court properly dismissed the complaint.
 19 Finally, plaintiff contends that the trial court erred in entering summary judgment in favor of National and Heritage, the sureties for CST and Lentin. Plaintiff alleges that there remained a factual issue whether the sureties had breached their performance bonds, that the sureties cannot assert defenses available to their respective principals until they have performed, and that the sureties may not invoke the waiver of claims provision of the construction contract because the provision is limited to the owner, contractor, subcontractor and sub-subcontractor.
We disagree that any factual issue was involved in the trial court's order of summary judgment for National and Heritage. *668 Whether the sureties were liable for nonperformance of their contracts because their principals had breached, as opposed to whether the sureties were released from the terms of their obligations due was a question of law appropriate for determination by summary judgment proceeding. As a general rule, the liability of a surety is measured by the liability of its principal. (Couch on Insurance 2d (rev. ed. 1982) sec. 47:12.) Such co-extensive responsibility has been interpreted to mean that where a bond is signed by a general contractor as principal and by an insurance company as a surety, no suit on the bond can be maintained against the surety unless it could have been maintained against the principal. (Board of Public Education v. Aetna Casualty & Surety Co. (1932), 35 Del. 100, 159 A. 367.) Thus, if a principal and surety are jointly sued and the action fails as to the principal, the surety is discharged. (American Casualty Co. v. Arrow Road Construction Co. (9th Cir.1962), 309 F.2d 923.) In the case at bar, the summary judgments in favor of Lentin and CST entitled their sureties to be discharged.
 20 Moreover, plaintiff is incorrect in stating that National and Heritage may not invoke the defenses available to their principals until they have performed the terms of their bonds. The rights and defenses of the principal belong to the surety by virtue of the relationships created by the surety contract. (Himrod v. Baugh (1877), 85 Ill. 435, 438.) Plaintiff's analogy to a surety's right to subrogation is misplaced.
 21 Finally, the waiver of claims provision in the contract applies to the sureties because the bonds executed by National and Heritage expressly incorporated the terms of the underlying construction contracts. Since the performance bonds and the contract are to be read as a single document (Fisher v. Fidelity & Deposit Co. (1984), 125 Ill. App.3d 632, 466 N.E.2d 332), the provisions of the contract are also the provisions of the bond.
We affirm.
Affirmed.
BILANDIC, P.J., and SCARIANO, J., concur.
