
659 N.E.2d 1312 (1995)
213 Ill.Dec. 665
168 Ill.2d 355
XL DISPOSAL CORPORATION (W. Robert Blair, Appellant)
v.
JOHN SEXTON CONTRACTORS COMPANY (John Sexton Contractors Company et al., Appellees).
No. 78505.
Supreme Court of Illinois.
December 21, 1995.
*1313 Gerald L. Angst, Steven J. Ellison and Susan A. Weber, Sidley & Austin, Chicago, for appellant.
Frank L. Winter and Michael T. Reynolds, Law Offices of Victor J. Cacciatore, Chicago, for appellee John Sexton Contractors Co.
Daniel S. Hefter, Chicago.
Justice FREEMAN delivered the opinion of the court:
As part consideration for assets of a business, the buyer, Sexton Contractors Company, agreed to pay an attorney who had done *1314 legal work for the seller, XL Disposal Corporation. Sexton later challenged the legality of the payments. We hold Sexton cannot challenge the payments for the reasons it asserted.

BACKGROUND
Robert Blair, an attorney, secured for XL Disposal Corporation (XL Disposal) land upon which it operated two waste transfer facilities. In August 1984, XL Disposal agreed to compensate Blair for his past services. A typewritten letter from Blair, signed by XL Disposal, confirmed the agreement. XL Disposal was to pay Blair, or his estate upon his death, $5,000 every month, the amount increased annually by 6%, from the letter's date until XL Disposal ceased operating the two facilities.
One of the facilities was located on South Laflin Street in Chicago. The Laflin Street facility was operated on land leased for a five-year term, from 1983 to 1988. The lease was renewable for four additional terms, but would end in 2008.
In June 1985, XL Disposal sold, subject to that lease, the assets of the Laflin Street facility to the John Sexton Contractors Company (Sexton). For the assets, Sexton agreed to pay XL Disposal $443,200 and to continue monthly payments, as modified, to Blair. Sexton promised to pay Blair $2,650 every month, with the same 6% yearly increase, from July 1985 until the time Sexton ceased to operate the Laflin Street facility. Sexton's promise was set out in an addendum to the letter stating XL Disposal's previous agreement to pay Blair. The addendum was incorporated by, and referred to, the typewritten contract stating the terms of the asset sale. Blair, himself, was not a party to the addendum.
In April 1989, Sexton, though it continued to operate the Laflin Street facility, stopped paying Blair. In turn, XL Disposal sued Sexton. XL Disposal sought a declaration that the asset sale contract obligated Sexton to continue to pay Blair.
Sexton raised numerous affirmative defenses in answer to the complaint: XL Disposal's agreement to pay Blair was fraudulent as based on past consideration; the agreement was an excessive legal fee arrangement; the agreement was contrary to public policy as a contingent-fee arrangement for Blair to lobby the City of Chicago for public contracts; Sexton's promise to Blair was similarly one for Blair to lobby for city contracts as Sexton's attorney and, therefore, the addendum was also an excessive fee agreement; and, finally, the promises of both XL Disposal and Sexton to pay Blair were perpetual contracts.
Sexton also filed a verified counterclaim, as amended, against Blair. The counterclaim stated five counts, each based on one or more of the affirmative defenses Sexton asserted against XL Disposal. Sexton sought declaratory relief and recovery of money it had paid to Blair.
Blair moved pursuant to section 2-619(a)(9) to dismiss Sexton's counterclaim. (Ill.Rev.Stat.1989, ch. 110, par. 2-619(a)(9).) Blair argued that Sexton had no standing to challenge XL Disposal's original promise to pay him. Further, Sexton's allegations that its payments were for something other than the assets of the Laflin Street facility were barred by the parol evidence rule. Blair also argued that neither XL Disposal's nor Sexton's promise to pay him was a perpetual contract, for a termination date could be ascertained in the lease under which the Laflin Street facility was operated.
XL Disposal moved for summary judgment (Ill.Rev.Stat.1989, ch. 110, par. 2-1005) on its complaint against Sexton. XL Disposal's arguments for summary judgment were the same ones Blair raised in his then still pending motion to dismiss Sexton's counterclaim.
Blair's motion to dismiss was granted and, four days later, XL Disposal was awarded summary judgment.
Sexton filed a notice of appeal which sought review of both the counterclaim's dismissal and the grant of summary judgment. The appellate court, ruling in Sexton's favor, reversed and remanded. (No. 1-91-1809 (unpublished order under Supreme Court Rule 23).) The court stated that Sexton had standing to challenge XL Disposal's agreement to pay Blair and that the trial judge *1315 was wrong not to find the agreement invalid. The court directed on remand that the trial judge was free to "review the reasonableness of the fees" and award Sexton any "excessive fees" it had paid to Blair.
Blair sought, and was granted, leave to appeal (145 Ill.2d R. 315).

DISCUSSION

The Appellate Court Order
In the appellate court, Sexton had challenged both the grant of Blair's motion to dismiss the counterclaim and the grant of XL Disposal's motion for summary judgment on its complaint. The appellate court did not separately consider the two rulings. Presumably, that was because the motions involved like bases, and an appeal of a section 2-619(a)(9) dismissal involves the same concerns as an appeal of a grant of summary judgment (see Kedzie & 103rd Currency Exchange, Inc. v. Hodge (1993), 156 Ill.2d 112, 116-17, 189 Ill.Dec. 31, 619 N.E.2d 732 (stating the standard of review)). But the motions were of different parties, were directed at or involved different pleadings, and sought different relief.
In directing that Sexton could be awarded fees found to be excessive, the appellate court effectively granted summary judgment for Sexton. Notwithstanding that Supreme Court Rule 366 would allow for entry of "any judgment * * * that ought to have been * * * made" or the grant of "any relief," the appellate court's ruling exceeded the scope of the appeal. (134 Ill.2d R. 366.) Sexton did not move for summary judgment against either Blair on its counterclaim or XL Disposal in a cross-motion for summary judgment. Certainly, Sexton's argument that it was not obligated to continue to pay Blair presented a legal question the court could decide. But no evidence whatsoever had been presented as to Blair's services by which any determination could be made about the reasonableness or unreasonableness of the compensation.
Blair alone has contested the appellate court's order and only the viability of Sexton's counterclaim against Blair is at issue. The disposition here is limited accordingly.

The Relationship Between the Parties as Affecting Sexton's Defenses
Sexton argues that its obligation cannot be separated from XL Disposal's agreement to pay Blair for legal services. In effect, Sexton says it stepped into XL Disposal's shoes and "assumed a direct contractual obligation to Blair." Therefore, Sexton says it can challenge the legality of XL Disposal's agreement to pay Blair as, for example, one for excessive legal fees, though it was not a party to it.
That particular argument is premised on the role this court plays in policing attorney discipline in Illinois. The court is duty-bound to guard against the collection of excessive legal fees, both contingent and fixed. (See In re Teichner (1984), 104 Ill.2d 150, 161, 83 Ill.Dec. 552, 470 N.E.2d 972; see generally 107 Ill.2d R. 2-106 (prohibiting the collection of an "illegal or excessive fee").) Sexton is implicitly relying on the notion that that duty should not be any less because the fee issue happens not to arise in a more familiar context like a disciplinary proceeding. It bears noting that Sexton did, in fact, file a complaint with the Attorney Registration and Disciplinary Commission against Blair on the fee issue, but no action was taken against Blair and the investigation was closed.
Blair argues that Sexton's obligation is distinct from his previous agreement with XL Disposal. That is, Sexton's promise to pay Blair was but a component of its contract payment to XL Disposal for the Laflin Street facility assets. It makes no difference, Blair says, that the consideration was in the form of monthly payments directed to him.
To support the respective contentions, the parties point to the different language of the asset sale contract and the addendum. The asset sale contract obligated Sexton to "assume the liability" of XL Disposal "as to" XL Disposal's agreement with Blair. But the addendum states only that Sexton had "agreed to pay" Blair and "to be bound by all the terms and conditions" of XL Disposal's agreement with him, though the amount was modified. In short, the parties see the case as turning on whether the phrase "assume *1316 the liability" in the asset sale contract means more than the phrase "agree[] to pay" in the addendum.
The point certainly figures in the disposition of this case. However, what must first be settled is Blair's status with respect to the asset sale contract between XL Disposal and Sexton. As already noted, the addendum stating Sexton's promise to Blair, whatever its nature, was made a contract term. The term conferred upon Blair, who was not a party to XL Disposal's and Sexton's contract, a direct benefit: monthly payments from Sexton. That made Blair a third-party beneficiary of the asset sale agreement.
Third-party beneficiary status is determined against "the contract and the circumstances surrounding the parties at the time of its execution." (Carson Pirie Scott & Co. v. Parrett (1931), 346 Ill. 252, 258, 178 N.E. 498.) Illinois follows the "intent to benefit" rule; that is, third-party beneficiary status is a matter of divining whether the contracting parties intended to confer a benefit upon a nonparty to their agreement. (See, e.g., Bates & Rogers Construction Corp. v. Greeley & Hansen (1985), 109 Ill.2d 225, 232, 93 Ill.Dec. 369, 486 N.E.2d 902; see generally J. Calamari & J. Perillo, Contracts §§ 17-3, 17-4, at 693-702 (3d ed. 1987) (noting that the "intent to benefit test" avoids the distinction between "donee" and "creditor" beneficiaries); see also Restatement (Second) of Contracts § 302 (1981).) The asset sale contract and the addendum it incorporates as a term plainly show Blair to be an intendedas opposed to an incidental third-party beneficiary of the asset sale contract between XL Disposal and Sexton. That makes Sexton the promisor with respect to Blair and XL Disposal the promisee.
By way of its counterclaim, Sexton sought to end the payments to Blair and to recover payments made. The question in this appealwhether Sexton's counterclaim can survive Blair's section 2-619 motion to dismisstakes the form of what defenses Sexton, as promisor, may assert against Blair, the intended third-party beneficiary. The counterclaim's alleged bases were, again, in substance, the affirmative defenses Sexton had raised in answer to XL Disposal's complaint.
The first of the grounds depended upon XL Disposal's relationship with Blair: that XL Disposal's agreement to pay Blair was fraudulent; that it involved excessive legal fees; and that the payments were part of an illegal lobbying contract or constituted a perpetual one. But Sexton also looked to its own relationship with Blair: Sexton alleged that Blair was really being paid for lobbying efforts as Sexton's attorney and that the arrangement involved excessive fees and was otherwise a perpetual contract.

Promisee-Based Defenses
Whether Sexton may allege in its counterclaim against Blair a basis for recovery arising from XL Disposal's agreement with Blair turns on whether Sexton did, in fact, step into XL Disposal's shoes in promising to make the monthly payments. To state the question rhetorically: May Sexton, as promisor, assert against Blair, the intended third-party beneficiary, defenses which XL Disposal, the promisee, might have against Blair? (See J. Calamari & J. Perillo, Contracts § 17-12, at 716-17 (3d ed. 1987).) The issue of whether a promisor can assert such defenses has not before arisen in Illinois. This case is even more novel because the defenses were not asserted in response to a claim by the third-party beneficiary as might normally be expected.
Nevertheless, the seminal decision is Rouse v. United States (D.C.Cir.1954), 215 F.2d 872. In that case, Bessie Winston had had installed in her home an oil burner which she financed with a promissory note. The United States, through the Federal Housing Administration, guaranteed the note's payment. Winston sold the home to John Rouse. The contract of sale contained a provision obligating Rouse "to assume payment of $850" for the oil burner. When Winston defaulted on her promissory note, the United States paid and sued Rouse. One of the defenses Rouse, the promisor, raised against the United States, the third-party beneficiary, was that the oil burner had not been installed satisfactorily, a defense Winston, the promisee, might have asserted.
*1317 The court held that Rouse could not assert the defense. The court said that whether a promisor could assert a defense against a third-party beneficiary that the promisee might have asserted against the beneficiary depended upon the nature of the obligation undertaken. If a promisor agrees to "`discharge whatever liability the promisee is under' "to the third-party, then the promisor must be allowed to step into the promisee's shoes to show that the promisee was "`under no enforceable liability.'" (Rouse, 215 F.2d at 874, quoting 3 S. Williston, Williston on Contracts § 811A (1936).) But if the promisor only agrees to pay a certain sum of money to the third party, it is immaterial whether the sum is actually owed by the promisee. (Rouse, 215 F.2d at 874, quoting 3 S. Williston, Williston on Contracts § 811A (1936).) In that situation, the promisor has no basis to assert a defense that the promisee might have enjoyed. The court concluded that a promise to assume amounts is a promise to pay irrespective of the promisee's liability. (Rouse, 215 F.2d at 874; see also J. Calamari 17-12, at 716 (3d ed. 1987).) Rouse could not assert Winston's defense that the oil burner had not been properly installed because Rouse had but agreed to assume the payment of an $850 sum.
Was Sexton's obligation, like Rouse's, one to pay Blair regardless of whether XL Disposal actually owed anything to him or was Sexton's obligation one to discharge a liability running between XL Disposal and Blair?
XL Disposal had agreed to pay Blair until such time as it "cease[d] to operate both of [its] waste transfer facilities." But the promise was not conditioned merely on XL Disposal's operation of the facilities. The promise to pay Blair continued as long any "successor[]" or "assign[ee]" of XL Disposal's interest in the facilities continued to operate them. Sexton was such a successor or assignee of XL Disposal's interest in the Laflin Street facility. And Sexton's promise to Blair was similarly conditionedSexton promised to pay until it "cease[d] to operate" the Laflin Street facilityreflecting XL Disposal's obligation to Blair. Ignoring, for the moment, that the monthly amounts Sexton and XL Disposal agreed to pay Blair differed, the like conditions make it seem that Sexton did assume XL Disposal's liability at least with respect to the Laflin Street facility.
But the condition stated in XL Disposal's obligation to Blair would also seem to undermine the notion that there was any liability for Sexton to assume. The conditiona condition subsequent to the promised payment (J. Calamari & J. Perillo, Contracts § 11-7, at 441-44 (3d ed. 1987); see also Wysocki v. Bedrosian (1984), 124 Ill.App.3d 158, 163, 79 Ill.Dec. 564, 463 N.E.2d 1339)seems to contemplate a single entity's operation of XL Disposal's two waste transfer facilities. XL Disposal promised to pay Blair until:
"XL [Disposal], its successors and assigns, in whole or part, including successors, assigns, and lessees of all or part of its interest in its said waste transfer facilities, ceases to operate both of said * * * facilities * * *."
The language can be reasonably read to say that XL Disposal's obligation depended upon the operation of both waste transfer facilities by either XL Disposal or a successor or assign of some or all of its business interests, including waste transfer. The sale of the Laflin Street facility's assets to Sexton would have meant that neither XL Disposal nor such a successor, assign, or lessee operated both facilities. XL Disposal's liability would be discharged with the sale leaving nothing for Sexton to assume.
A closer look at the nature of XL Disposal's promise to Blair further shows that XL Disposal's promise to Blair did not represent liability Sexton could assume. XL Disposal said that it was indebted to Blair for past legal services. That reason explained XL Disposal's promise to pay him. But XL Disposal's promise could hardly be said to be based upon a liquidated debt for the actual value of legal services rendered. What amounts Blair was "owed" were determined only in connection with operation of both waste transfer facilities. If XL Disposal had closed one of its facilities the day after the August 1984 agreement with Blair took effect, XL Disposal's "liability" for the legal services of Blair would have been completely *1318 discharged. That is so regardless of the fact that Blair might have gone undercompensated.
If XL Disposal's promise to pay Blair did not represent an independently ascertainable liability of XL Disposal, what liability of XL Disposal could exist for Sexton to assume? Sexton's promise to pay Blair until it ceased operating the Laflin Street facility was its own, separate promise to Blair. That that promise was separate from any "liability" of XL Disposal is evident in the fact that Sexton, too, controlled the extent of its own obligation. If Sexton had stopped operating the Laflin Street facility one day after the asset sale contract took effect, it would owe Blair no further payments.
Finally, there is the matter of the amount of Sexton's promised payments to Blair. Sexton promised to pay roughly half of the amount that XL Disposal had promised to pay Blair. Presumably, that was because Sexton's paymentconnected to only one of the two waste transfer facilitieswould be roughly half of XL Disposal's obligation to Blair in operating both. Sexton's argument would be that it is sufficient to have stepped into only one of XL Disposal's shoes to enable it to assert defenses XL Disposal would be entitled to. Sexton has not directed us to, nor have we found, authority stating that the assumption of only part of a promisee's liability to a third-party entitles a promisor to avail himself of the promisee's defenses.
We conclude that Sexton promised no more than to pay Blair the monthly sums independent of whether XL Disposal truly owed Blair anything. Sexton therefore cannot assert defenses which XL Disposal, as promisee, might have asserted based on its relationship with Blair. The trial judge was correct to dismiss the counts of Sexton's counterclaim alleging that XL Disposal's agreement to pay Blair was fraudulent, involved excessive legal fees, was against public policy, or was a perpetual contract.

Sexton's Own Defenses as Promisor
That leaves for consideration the defenses Sexton, as promisor, raised against Blair, the third-party beneficiary. Those defenses related to Blair's alleged service as Sexton's own attorney in lobbying for city contracts and the duration of Sexton's promised payments.
A third-party beneficiary's rights depend on the validity of the contract creating them. (Gallopin v. Continental Casualty Co. (1937), 290 Ill.App. 8, 13, 7 N.E.2d 771; see A. Corbin, Corbin on Contracts ch. 44, § 818 (1952).) And, therefore, a promisor may assert as a defense to the third-party beneficiary's claims under the contract the "absence of mutual assent or consideration, lack of capacity, fraud, mistake and the like." Restatement (Second) of Contracts § 309, Comment, at 458 (1981); see also A. Corbin, Corbin on Contracts ch. 44, § 818 (1952).
But the defenses Sexton alleged as promisor in its counterclaim do not go to the validity of the asset sale contract. What Sexton has attempted to do is to assert defenses to its obligation to pay Blair based upon some other direct contractual relationship with Blair. It bears repeating that the addendum stating Sexton's specific promise to Blair was simply a term of the asset sale contract. The addendumto which Blair was not a partycould create no separate contractual relationship between Sexton and Blair. Therefore, the allegations of Sexton's counterclaim that its payments to Blair were excessive legal fees or constituted a perpetual contract were also properly dismissed.

Conclusion
We reverse the appellate court and affirm the judgment of the circuit court dismissing Sexton's amended counterclaim against Blair.
Appellate court reversed; circuit court affirmed.
BILANDIC, C.J., and HARRISON, J., took no part in the consideration or decision of this case.
