
472 A.2d 1214 (1984)
CITY OF WARWICK
v.
BOENG CORPORATION.
No. 83-320-Appeal.
Supreme Court of Rhode Island.
March 13, 1984.
*1216 Joseph A. Kelly, Carroll, Kelly & Murphy, Providence, for plaintiff.
John A. MacFadyen 3rd, James H. Leavey, Temkin & Miller, Ltd., Providence, for defendant.

OPINION
SHEA, Justice.
This is an appeal by the defendant Boeng Corporation (Boeng) from a judgment entered against it after a trial without a jury in Superior Court. The plaintiff, city of Warwick (city), sued for breach of contract, and the defendant alleged that the contract was void as against public policy, lacked consideration, and was not enforceable because of the doctrine of frustration of purpose and unconscionability. The trial justice found for the plaintiff. We affirm.
The State of Rhode Island had been leasing a building located in the city of Warwick and owned by Boeng for use as the Kent County Courthouse (courthouse) since 1974. The lease contained an option to purchase. The Public Buildings Authority[1] (PBA) decided to exercise the option and buy the property.
According to G.L. 1956 (1977 Reenactment) § 37-14-3, as it existed in April 1979,[2] the legislative body of the municipality in which the land was located was required to approve the transfer prior to issuance of revenue bonds by the PBA. The city, through its executive, Mayor Joseph W. Walsh (mayor), at first refused to recommend approval of the sale of the building to the PBA because the sale of the property *1217 to a state agency would remove it from the city tax rolls. Taxes on the property totaled approximately $70,000 per year. The state refused to pay the local property taxes or to enter into an agreement with the city concerning the payment.
Boeng, through its president Robert B. Boyer (Boyer) and his counsel, began negotiations with the mayor and other city officials. The two parties entered into negotiations concerning the property and payment to the city. As a result of these negotiations an agreement, entitled "Tax Indemnification Agreement" (agreement), was signed on April 16, 1979, by Boyer on behalf of Boeng and delivered to Warwick City Hall. The agreement contained the following two pertinent provisions:
1. That Boeng would deposit $141,102 in an escrow account at the time of the property transfer to the PBA as recompense for two years of lost taxes to the city;
2. That the agreement would "take effect upon the completion of the appropriate municipal legislative action as required by Title 37, Chapter 14, Section 3 R.I.G.L. 1956, as amended, and the sale of the subject real property by BOENG to the Rhode Island Public Buildings Authority."
On April 16, 1979, the Warwick City Council, upon learning of the mayor's positive recommendation, passed resolution R-79-121 approving the acquisition of the courthouse by the PBA. The mayor approved the resolution on April 17, 1979. At the same meeting on April 16, the city council also passed resolution R-79-120, authorizing the Warwick finance director to sign the agreement on behalf of the city. This resolution was signed by the mayor on April 20, 1979. The agreement was signed by the finance director on April 23, 1979.
The Rhode Island General Assembly passed and sent to the Governor Senate bill 79 S-1086, which had been introduced in the Senate on March 21, 1979. The bill would remove the necessity for approval by municipalities in the sale of judicial complexes to the PBA.[3] The bill became law on May 9, 1979, without the Governor's signature.
On July 19, 1979, the PBA and Boeng entered into a purchase-and-sale agreement for the courthouse. On August 24, 1979, the closing was held, transfering the title of the courthouse building and surrounding parking area to the PBA. Boeng did not pay the $141,102 into escrow as required by the agreement.
The city filed suit against both Boeng Corporation and its president, Robert Boyer, to recover the agreed-upon sum. The case was heard without a jury, and the trial justice made findings of fact and law. The claim against Boyer personally was dismissed. Judgment was entered for plaintiff. The defendant, Boeng, appealed from this judgment, raising four issues:
1. Whether the Tax Indemnification Agreement was contrary to public policy and, as such, void
2. Whether the court's refusal to allow defendant to amend its answer was an abuse of discretion
3. Whether the trial justice's finding that the agreement was a nonintegrated contract was clearly wrong
4. Whether defendant's duty under the contract was waived under the doctrine of frustration of purpose and unconscionability.

I
Contracts with municipalities are measured by the same tests and are subject to the same rights and liabilities as are other contracts. 10 McQuillin, Municipal Corporations § 29.124 at 560 (3d rev. ed. 1981). In the present case there is no question that a valid contract was formed. Boeng promised to pay the city $141,102 in *1218 lieu of the taxes that would have been paid on the property were it not to be acquired by a state authority. In exchange, the mayor promised to recommend passage of a resolution authorizing the sale. There were two conditions precedent to Boeng's promise to pay the city the $141,102  that the resolution authorizing the sale be passed by the Warwick City Council and that the sale of the property by Boeng to the PBA be completed. Both of these conditions were subsequently met. The agreement was reduced to writing and signed by both parties.
The defendant claims, however, that the contract is against public policy and therefore void. It is a general rule that a contract or agreement against public policy is illegal and void. See, e.g. Weil v. Neary, 278 U.S. 160, 174, 49 S.Ct. 144, 149-50, 73 L.Ed. 243, 251 (1929). Although the meaning of the phrase "public policy" is vague, a contract or agreement is generally against public policy if it is injurious to the interests of the public, interferes with the public welfare or safety, is unconscionable, or tends to injustice or oppression. See Calamari & Perillo, The Law of Contracts § 22-1 at 780 (2d ed. 1977). However, a party who has received the benefit of the performance of a contract will not be permitted to deny his or her obligations unless paramount public interest requires it. Steele v. Drummond, 275 U.S. 199, 205, 48 S.Ct. 53, 54, 72 L.Ed. 238, 240 (1927).
The defendant alleges that a municipality cannot make a valid contract based upon the payment of money in return for an official's promise to recommend passage of legislation, regardless of the official's intention or the effect of the legislation. We do not agree. Generally, in situations in which no improper means are contemplated or bargained for, the bargain is not invalidated merely because the compensation to a party is contingent on the enactment of legislation. Coyne v. Superior Incinerator Co. of Texas, 80 F.2d 844, 846 (2d Cir.1936); 15 Williston, A Treatise on the Law of Contracts § 1729 at 8 (3d ed. Jaeger 1972). The public policy is to ensure that governmental decisions are made in the public interest and not conditioned on the personal interests or gain of a particular government official.
In the present case, the mayor bargained in the public interest to preserve and protect the tax base of the city. He sought compensation from defendant for the loss to the city of a large yearly tax that would have resulted if the agreement had not been reached and the sale to the PBA approved. There is no allegation or evidence that the mayor or any of the city's agents acted improperly or with anything but the public's interest in mind. A contract that was executed in the public interest without any improper motives on the part of the parties is not against public policy and therefore not void.

II
One week before trial defendant made a motion under Rule 15 of the Superior Court Rules of Civil Procedure to amend its answer. The amendment was offered to include, among other things, the allegation "that the Plaintiff's actions were ultra vires and in violation of the Rhode Island Constitution, Rhode Island statutes, and the Charter of the City of Warwick." The trial justice denied this portion of defendant's amended answer. The defendant on appeal claims that the trial justice abused his discretion in denying this portion of the motion.
It is the law of this state that amendments to pleadings should be liberally allowed in the spirit of Rule 15. Serra v. Ford Motor Credit Co., R.I., 463 A.2d 142, 150 (1983). However, amendments to an answer may properly be denied when the amendment would assert a defense that is not available to a defendant. In the case before us, the trial justice correctly denied defendant's motion to amend its answer because the defense of ultra vires was not available to defendant. As this court stated in Newport Hospital v. Ward, 56 R.I. 45, 58, 183 A. 571, 577 (1936):

*1219 "One who deals with a municipal corporation is bound to take notice of the extent of its powers. The protection of such corporation from the unauthorized acts of its officers and agents is a matter in which the whole community is concerned."
See also McAleer v. Angell, 19 R.I. 688, 694-95, 36 A. 588, 590 (1897) ("persons dealing with a municipal corporation or its officers are bound at their peril to inquire into the power of the municipality or its agents to make the contract * * *"); Austin v. Coggeshall, 12 R.I. 329, 332 (1879) ("[i]t is well settled that a municipal corporation, when sued directly on a contract which it is incapable of making, cannot be estopped from taking advantage of its incapacity * * *"); and 10 McQuillin, Municipal Corporations § 29.133 at 578 ("[t]he general rule is that one who makes a contract with a municipality is estopped to assert that it was ultra vires, when it is sought to be enforced against him * * *"). Therefore, even if defendant were allowed to show that the city contracted beyond its constitutional, statutory, or chartered powers, it would be estopped from asserting this claim. The trial justice correctly denied defendant's motion to amend its answer to include the defense of ultra vires.

III
The defendant, in its third issue on appeal, claims that the trial justice was clearly wrong in ruling that the agreement was not an integrated contract. The defendant claims that because of this incorrect ruling, the court improperly admitted parol evidence to find consideration for the contract  that is, the passage of the city's resolution authorizing the sale of the property to the PBA. The defendant's argument, however, is self-defeating.
A writing that does not on its face appear to be supported by consideration is not totally integrated, see 2 Restatement (Second) Contracts § 210, comment c at 118-19 (1981); and therefore, the parol-evidence rule does not apply. Extrinsic evidence is admissible to show the existence of consideration. Del Sesto v. Turchetta, 85 R.I. 474, 477, 133 A.2d 130, 131 (1957); see also Calamari & Perillo, The Law of Contracts § 3-4 at 112. This rule follows logically from the basis of the parol-evidence rule. The parol-evidence rule is applicable only to integrated contracts. A writing absent consideration is not integrated, and therefore, extrinsic evidence to show consideration is admissible and does not violate the parol-evidence rule.
The trial justice's ruling that the contract was not integrated was correct. The city's resolutions were admissible to show consideration because of the apparent lack of consideration on the face of the agreement.

IV
The defendant's final argument is that the elimination of the statutory requirement that municipal approval is required before the property can be sold to the PBA for judicial complexes frustrated the purpose of the contract and that therefore defendant's duty to perform was waived. The defendant's reliance on this doctrine, however, is misplaced.
In order to excuse a party's duty to perform under a contract, the purpose underlying the contract must be totally and unforeseeably destroyed. Simpson, Handbook of the Law of Contracts § 182 at 370 (2d ed. 1965). In the instant case neither the purpose of the contract nor the value of the consideration at the time the contract was entered into was destroyed. Boeng contracted with the city to allow it to sell its property to the PBA. The city contracted to recover some of the lost taxes that resulted from the sale of the property to the state authority. The purpose of the contract was to allow Boeng to sell the land to the PBA. When the city council passed the resolution authorizing the sale, the purpose was completed  Boeng was allowed to sell its property to the PBA and the city should have received the agreed-upon sum.
*1220 The defendant relies on the old English case commonly referred to as "the coronation case." In Krell v. Henry, [1903] 2 K.B. 740, Krell rented Henry his apartment for two days to view the coronation of King Edward VII, and Henry agreed to pay seventy-five pounds. The coronation was canceled because the king was stricken with appendicitis. Henry did not take the room and refused to pay Krell because of the cancellation, prompting Krell to sue.
The court held that Henry was excused from his duty to pay Krell because the purpose of the contract  the viewing of the king's coronation  was frustrated by its cancellation. Boeng's purpose in entering the contract was not frustrated by the subsequent amendment to the municipal-approval requirement. Boeng sold the property to the PBA, and the city should have received the agreed-upon sum.
For all of the above reasons, the defendant's appeal is denied and dismissed, the judgment appealed from is affirmed, and the papers of the case are remanded to the Superior Court for further proceedings.
NOTES
[1]  The Public Buildings Authority was established in 1958 "to maintain the high standards of public facilities within the state." General Laws 1956 § 37-14-3. It is authorized to acquire, construct, and maintain public facilities upon the request of the proper federal agency, the General Assembly or Governor, or the legislative body of a municipality seeking a public facility. General Laws 1956 (1977 Reenactment) chapter 14 of title 37.
[2]  General Laws 1956 (1977 Reenactment) § 37-14-3 read in pertinent part that the PBA "shall require, prior to issuance of such revenue bonds, approval by resolution of the legislative body of the municipality in which they are proposed to be located."
[3]  Public Law 1979, ch. 360, § 1: "except those public facilities to be used in connection with projects to provide judicial complexes, administrative offices, educational facilities and warehouse facilities."
