
76 Ill. App.3d 725 (1979)
394 N.E.2d 1283
FELBINGER AND COMPANY, Plaintiff-Appellant,
v.
NICHOLAS TRAIFOROS, Defendant-Appellee.
No. 78-1583.
Illinois Appellate Court  First District (2nd Division).
Opinion filed September 4, 1979.
*726 *727 Karr, Moran and Felbinger, Ltd., of Chicago (Thomas P. Valenti, of counsel), for appellant.
Friedman & Solber, Ltd., of Chicago (Frederick M. Ellis, Jr., of counsel), for appellee.
Reversed and remanded.
Mr. JUSTICE DOWNING delivered the opinion of the court:
Plaintiff, Felbinger and Company (Felbinger), appeals an order of the circuit court of Cook County dismissing count I of its second amended complaint against defendant, Nicholas Traiforos (Traiforos), for his breach of an exclusive right to sell agreement. The issues for *728 review are (1) whether the brokerage agreement signed by the defendant beneficiary of the land trust in which the subject property was held is enforceable, (2) whether, under the terms of the agreement, the defendant's conveyance of the property by a deed in lieu of foreclosure obligated him to pay the plaintiff a commission; and (3) whether the defendant's conveyance of the property occurred within the 18-month period of the plaintiff's exclusive agency. The facts are as follows.
On July 15, 1968, the subject property known as Mayfair Industrial Park, located in Elk Grove Village, Illinois, was placed in a land trust. The LaSalle National Bank (bank) held title to the property; defendant Traiforos and Gus King were the named beneficiaries of the trust. On or about July 26, 1971, defendant Traiforos employed the plaintiff real estate brokerage company as its agent for the sale or lease of the subject property for a period of 18 months. In the real estate brokerage agreement, the defendant agreed, inter alia, to pay the plaintiff a real estate brokerage commission in an amount determined by the applicable rate established by the Chicago Real Estate Board "if the property is sold or leased by you, by me (owner), or by or through any other person, during the period hereof."
Three months later, in October 1971, Jack R. Courshon, as nominee of the trustees of First Mortgage Investors' (FMI), instituted a proceeding against the bank to foreclose its mortgage on the subject property. On December 26, 1972, the bank deeded the property to Courshon, as nominee. On March 13, 1973, the foreclosure suit was dismissed with prejudice on the stipulation of the parties. On February 27, 1975, plaintiff filed its complaint alleging, inter alia, that in full performance of its obligations it had expended and incurred expenses of $20,000, that the defendant had sold the property for approximately $1,300,000, and therefore that defendant was obligated to pay it a commission of $75,000. The plaintiff sought a recovery of $95,000.
Defendant Traiforos thereafter filed a motion to dismiss the plaintiff's complaint pursuant to section 48 of the Civil Practice Act (Ill. Rev. Stat. 1977, ch. 110, par. 48), alleging, inter alia, (1) that the exclusive right to sell agreement was unenforceable since it had not been signed by the bank legal titleholder; (2) that upon the institution of the foreclosure proceedings, the plaintiff's exclusive right to sell the subject property became void and against public policy, the defendant's authority to act pursuant to the agreement was revoked, and the defendant's deed in lieu of foreclosure was involuntarily given and therefore did not constitute a sale; and (3) that the alleged sale did not occur until either January 29, 1973, or after February 21, 1973. In support of his motion to dismiss, the defendant filed (a) a copy of the February 21, 1973, order of the circuit *729 court dismissing some of the claims on the mechanics liens filed against the property in FMI's mortgage foreclosure proceedings, but leaving other claims unaffected, and (b) a copy of the March 13, 1973, order dismissing with prejudice FMI's petition for foreclosure.
Following a hearing, the trial court sustained the defendant's motion but granted the plaintiff leave to file an amended complaint. Count I of plaintiff's amended complaint realleged the original allegations with the exception that it increased the alleged sale price to $1,500,000. Following the defendant's second motion to dismiss, plaintiff was granted leave to file a second amended complaint to add Courshon as nominee of FMI as a party. In count II of the second amended complaint, plaintiff alleged that at all times FMI knew of the July 26, 1971, brokerage agreement and tortiously interfered with the plaintiff's contractual rights thereunder.
Following a hearing on the defendant's motions to dismiss, the trial court found (1) that the debt for which the property stood as security was delinquent; (2) that there was a conveyance of the real estate by deed in lieu of foreclosure; (3) that there was no financial consideration for the conveyance other than the cancellation of the debt; and (4) that as a matter of fact and law, the deed in lieu of foreclosure was not a conveyance under the terms of the agreement which would give rise to the defendant's obligation to pay a brokerage commission. Based on these findings, the trial court dismissed count I of the plaintiff's second amended complaint against defendant Traiforos; dismissed count II against defendant FMI with leave to file a third amended complaint; entered the order nunc pro tunc as of June 12, 1978; and ordered FMI to file an affidavit in support of its representation to the court that no consideration other than the cancellation of the defendant's note was given for the deed in lieu of foreclosure.
Plaintiff appeals only from that portion of the order dismissing count I of its complaint seeking vacature of the judgment for the defendant, and either a new trial or the entry of judgment for it.

I.
The defendant first contends that the exclusive real estate brokerage agreement is unenforceable because it was signed by him as the owner of the subject property rather than by the LaSalle National Bank, the legal titleholder of the property.
 1-4 While contracts of sale or lease signed by beneficial owners as the unauthorized agents of the trustees or signed without disclosing to the purchasers or lessees that the beneficiary was acting as a beneficiary and that the property was held in trust are unenforceable (see Feinberg v. Great Atlantic & Pacific Tea Co. (1970), 131 Ill. App.2d 1087, 266 N.E.2d *730 401, and Madigan v. Buehr (1970), 125 Ill. App.2d 8, 260 N.E.2d 431), as stated by this court in Ellis Realty v. Chapelski (1975), 28 Ill. App.3d 1008, 1011, 329 N.E.2d 370:
"A seller engages a real estate broker to find a purchaser, and this is the extent of the broker's undertaking. [Citations.] A real estate broker earns his commission when he produces a purchaser who is ready, willing and able to meet his principal's terms. [Citations.] The broker can perform the services requested of him without affecting title to or possession of the property being offered for sale. Consequently, liability for payment of the commission does not depend on whether the principal has authority to enter into a binding contract to sell or to convey. The land trustee's participation is necessary to convey the trust property and under some circumstances may be required to execute a binding contract of sale, but the trustee's approval is not required to engage the services of a real estate broker or to authorize a broker to find a purchaser at a specified price."
Thus, we agree with the plaintiff that the listing agreement in question is a simple contract for services which may render the signer personally liable on performance by the plaintiff regardless of the status or type of title to the property involved. See Erbach & Haunroth Realtors v. Burnett (1975), 31 Ill. App.3d 236, 239, 333 N.E.2d 592.

II.
The parties do not dispute the fact that the language "if the property is sold * * *, by me [owner], or by or through any other person, during the period hereof" indicates an intention on the part of the defendant to obligate himself to pay the broker a commission if the property was sold by anyone including the defendant between July 26, 1971, and January 26, 1973. (See Brown v. Miller (1977), 45 Ill. App.3d 970, 360 N.E.2d 585.) Plaintiff's contention is that the principle established in Whiteman & Co. v. Fidei (1954), 176 Pa. Super. 142, 106 A.2d 644, and Schulte v. Crites (Mo. App. 1957), 300 S.W.2d 819, appeal after remand (Mo. 1958), 318 S.W.2d 387, is applicable to the instant case. In Whiteman and Schulte, the courts held that the words "sell" and "sold" in the brokerage agreements there under consideration comprehended a conveyance to a mortgagee by a deed in lieu of foreclosure, in satisfaction of the defendants' mortgage debt. The construction that plaintiff would apparently put on these cases is that, in every instance, the transfer of a deed in lieu of foreclosure is a "sale."
Whiteman was tried on stipulated facts resulting in a decree dismissing the complaint and entering judgment for the defendants. The stipulated facts of relevance to the Pennsylvania court revealed that the *731 purchase money mortgage became in default approximately one month before the parties entered into the three-month exclusive right to sell agreement whereby the defendants agreed to pay the plaintiff a commission if the property was "sold or exchanged within such period." Within two months thereafter, the defendants executed a deed which reconveyed the property to the mortgagees, who had threatened to institute forclosure proceedings if the delinquent payment or the conveyance of property to them was not made on that date. Although the deed recited a nominal consideration of $1, it was also stipulated that the true consideration was the payment of $1,000 and the release of the defendants' indebtedness in the amount of $18,600. In reversing the judgment for the defendants and entering judgment for the plaintiff, the appellate court stated:
"Under the facts here, we hold the conveyance of the property by the owner to the mortgagees in return for full release of liability under the mortgage and bond, plus payment by the mortgagees of $1,000.00 to the owner, constituted a `sale' within the terms of the contract between the owner and real estate broker and the broker is therefore entitled to his commission." (Emphasis supplied.) Whiteman & Co. v. Fidei (1954), 176 Pa. Super. 142, 147, 106 A.2d 644, 646.
Similarly, Schulte was tried before a jury which returned a verdict for the defendants. The trial court sustained the plaintiffs' motion for a new trial based on an erroneous jury instruction, and the defendants appealed from that judgment. The Missouri appellate court opinion noted (1) that in the five years prior to the 12-month exclusive right to sell agreement, the defendants had executed two deeds of trust on the land which was the subject of the brokerage agreement to secure demand notes of $19,900, and another deed of trust on contiguous land to secure a $750 demand note; (2) that, although the testimony was conflicting, the defendants told the plaintiffs at the time of the execution of the brokerage agreement that the reason for selling the property was to pay off the mortgages in an amount of approximately $18,000; (3) that, although the brokerage agreement named a sale price considerably in excess of the amount of the mortgage debts, it provided for a commission upon a sale for a lesser figure; and (4) that one of the defendants, in the presence of the plaintiffs, had offered to sell the property for $16,000 and had indicated that the plaintiffs would have been paid their commission on that price. The court concluded that:
"All the evidence indicates that a sale of the land in an amount sufficient to extinguish the mortgage debts was within the reasonable contemplation of the parties." (Emphasis supplied.) (Schulte v. Crites (Mo. App. 1957), 300 S.W.2d 819, 822-23.)
*732 The court affirmed the judgment of the trial court granting the plaintiffs a new trial.
Implicit in Whiteman and Schulte are the holdings that it was the intention of the parties to the respective contracts that the term "sale" would include a deed in lieu of foreclosure. Therefore, there is nothing in these cases to suggest that we must abandon the rule that provides that the primary object of the construction of a contract is to give legal effect to the intention of the parties. See Baird & Warner, Inc. v. Ruud (1976), 45 Ill. App.3d 223, 228-29, 359 N.E.2d 745.
 5, 6 A sale of real estate is ordinarily defined as the actual transfer of title from grantor to grantee by an appropriate instrument of conveyance (Keogh v. Peck (1925), 316 Ill. 318, 328, 147 N.E. 266) for money (Close v. Browne (1907), 230 Ill. 228, 236, 82 N.E. 629), but the term is broad enough to include the transfer of property for any sort of valuable consideration including the extinguishment of debts (see Schulte, at 823; Pender v. Commissioner of Internal Revenue (4th Cir.1940), 110 F.2d 477, 478, cert. denied (1940), 310 U.S. 650, 84 L.Ed. 1416, 60 S.Ct. 1103, cited with approval in Wieboldt v. Commissioner of Internal Revenue (7th Cir.1940), 113 F.2d 384, 385-86, which was followed in Day's Estate v. Commissioner of Internal Revenue (7th Cir.1941), 117 F.2d 208, 209). Moreover, a "sale" may be effected even though the grantee is the holder of a note secured by a mortgage instead of to a third party, and even though it was made to avoid foreclosure and was therefore involuntary. (Schulte.) However, ultimately, the term "sale" has no fixed or invariable meaning but is to be interpreted in accordance with the manifest intention of the parties. (91 C.J.S. Vendor & Purchaser § 1, at 828 (1955).) Thus, although a deed in lieu of foreclosure may, as a matter of law, constitute a "sale" entitling a broker to a commission (Schulte; Whiteman), whether the parties to the instant exclusive right to sell agreement so intended is the question presented on this appeal.
 7 The contract in the instant case is silent as to whether the parties intended to make a distinction between a sale to a third party for money or a sale by deed in lieu of foreclosure to the defendant's mortgagee for the satisfaction of the defendant's debts. Since we have determined, as a matter of law, that the term "sale" in this agreement is initially susceptible to both of these meanings, the latent ambiguity doctrine is applicable (see General Casualty Co. v. Elam (1972), 8 Ill. App.3d 215, 220-21, 289 N.E.2d 699), and parol evidence is necessarily admissible to demonstrate and explain the ambiguity (see Cory v. Minton (1977), 49 Ill. App.3d 312, 316, 364 N.E.2d 311; see also Baird & Warner, Inc., at 229). Insofar as this case has reached us solely on the pleadings, the record before us is devoid of any such parol evidence which would enable us to read the agreement in light of the circumstances surrounding the parties at the time it was *733 entered into and of the objects which they then evidently had in view. Therefore, unlike in Schulte and Whiteman, we are unable to resolve this latent ambiguity as to which meaning the parties ascribed to the term "sale."
 8 However, the law is well settled that an action should not be dismissed for failure to state a cause of action, unless it clearly appears that no set of facts could be proved under the pleadings which would entitle the plaintiff to relief. (J.J. Harrington & Co. v. Timmerman (1977), 50 Ill. App.3d 404, 407, 365 N.E.2d 721.)[1] Considering the allegations of the plaintiff's amended complaint in the light most favorable to the plaintiff and taking as true all well pleaded facts and inference which can be drawn therefrom (J.J. Harrington & Co.), we find those allegations sufficient to set forth a cause of action upon which relief may be granted upon the trial of the matter.
 9, 10 Nor are we dissuaded from this view by the defendant's contention that the brokerage agreement was legally impossible to perform due to the institution of the mortgage foreclosure proceedings. Generally, where parties, by their own contract and positive undertaking, create a duty or charge upon themselves, they must abide by the contract, and subsequent contingencies not provided against in the contract which render performance impossible do not bring the contract to an end. (Leonard v. Autocar Sales & Service Co. (1945), 392 Ill. 182, 187, 64 N.E.2d 477, cert. denied (1946), 327 U.S. 804, 90 L.Ed. 1029, 66 S.Ct. 968.) A contractual duty may be discharged where performance is subsequently prevented or prohibited by judicial action. (Restatement of Contracts § 458 (1932).) However, that duty will not be discharged by judicial action if there are circumstances showing a contrary intention or contributing fault on the part of the person subject to the duty. (Restatement of Contracts § 458 (1932).) Legal impossibility does not excuse performance as long as it lies within the power of the promisor to remove the obstacle to performance (17A C.J.S. Contracts § 467, at 636 (1963).) Moreover, a construction that the parties intended to absolutely bind themselves must be put upon an unqualified undertaking where the event which caused the impossibility might have been anticipated or guarded against in the contract. Leonard, at 189.
 11, 12 Applying these principles to the instant case, at the outset we note that neither the insolvency of the promisor, the institution of *734 bankruptcy proceedings, nor the appointment of a receiver will legally discharge one from a duty to perform. (6 Corbin on Contracts § 1332, at 362-64 (1962).) In light of the foregoing, we fail to see how FMI's institution of the foreclosure proceeding can be said to have rendered the sale of the subject property legally impossible to perform. That it did not is evidenced by the defendant's deed of the subject property to FMI and the court's dismissal of the foreclosure proceeding upon the stipulation of the parties. Moreover, even accepting arguendo the defendant's contention, the arguable impossibility of performance arose due to the defendant's default on his mortgage. Thus, the defendant's contributing fault gave rise to an obstacle which lay within his power to remove. Finally, the lapse of only three months between the date of the listing agreement and the institution of the foreclosure proceedings gives rise to a reasonable inference that the defendant entered into the real estate brokerage agreement with the knowledge that the event assertedly rendering performance impossible was forthcoming and, therefore, that the defendant could have guarded against it in the contract. Under these circumstances, we find the defendant's assertion of legal impossibility of performance to be without merit.

III.
Relying on section 1 of the Illinois Mortgage and Foreclosure Act (Ill. Rev. Stat. 1977, ch. 95, par. 23), the defendant also contends that, assuming that his trustee's deed in lieu of foreclosure constituted a "sale," the sale did not occur until the March 13, 1973, order of the trial court dismissing the foreclosure proceeding was entered. Thus, the defendant maintains that the sale did not occur within the 18-month period of the parties' exclusive right to sell agreement.
The defendant's reliance on section 1 of the Illinois Mortgage and Foreclosure Act is misplaced. That section prohibits the extinguishment of a mortgagor's statutory right of redemption by a mortgagee's exercise of a contractual power to privately convey the property to a third person without a judicial judgment or decree. (See McGuire v. Cohen (1963), 44 Ill. App.2d 375, 384, 387-88, 195 N.E.2d 280.) Such is not the situation here.
 13-16 In the absence of fraud, undue influence, oppression, or the like, a mortgagee may acquire the mortgagor's equity of redemption or the entire estate for a valuable consideration. (27 Ill. L. & Prac. Mortgages § 241, at 280-81 (1956).) Generally, the whole estate is then vested in the mortgagee which results in a merger of the mortgage indebtedness and the title to the property in the mortgagee so that the mortgage is discharged and the mortgage debt is satisfied. (27 Ill. L. & Prac. *735 Mortgages § 242, at 283 (1956).) When the indebtedness secured by the mortgage has been discharged, foreclosure proceedings may be voluntarily or involuntarily dismissed before a decree is rendered. (27 Ill. L. & Prac. Mortgages § 401, at 429-30 (1956).) Although the conveyance may constitute a deed absolute or may constitute a mortgage furnishing additional security, the conveyance takes effect when delivered and its character as determined by the intention of the parties is fixed at that time. 27 Ill. L. & Prac. Mortgages § 245, at 290 (1956).
 17 In the instant case, the bank as mortgagor and trustee of the land trust, of which the defendant was the beneficiary, deeded the subject property to the mortgagee FMI on December 26, 1972. The defendant has not argued that this conveyance was for insufficient consideration, was made under duress, oppression, or the like, failed to extinguish the indebtedness secured by the mortgage, or was merely conveyed as additional security for the mortgage. The real estate brokerage agreement did not expire until January 26, 1973. Applying the foregoing principles to these facts, we find the defendant's argument that the deed was not effective until after the expiration of the real estate brokerage agreement to be without merit.

IV.
Since we have found the plaintiff's allegations sufficient to withstand the defendant's motion to dismiss, but the language of the contract latently ambiguous and insufficient to determine the intention of the parties, the order of the trial court must be reversed and remanded for further proceedings consistent with the views expressed herein. Upon the trial of this matter, it may be determined that the parties did not intend the term "sale" to mean the defendant's deed in lieu of foreclosure to his mortgagee so that there could be no recovery on the contract.
 18 However, a quasi-contract does not depend on the intention of the parties, but exists where there is a plain duty and a consideration, and an unjust enrichment. (County of Champaign v. Hanks (1976), 41 Ill. App.3d 679, 682, 353 N.E.2d 405.) The essential element of a quasi-contract is the receipt of a benefit by one party under circumstances where it would be inequitable to retain that benefit without compensation. First National Bank v. Glenn (1971), 132 Ill. App.2d 322, 324, 270 N.E.2d 493.
 19 The plaintiff alleges that it expended and incurred expenses of $20,000 in the performance of its obligations under the real estate brokerage agreement for the defendant's benefit. If in fact the plaintiff expended such sums, and if it is found that the defendant took advantage of plaintiff's efforts and services thus depriving plaintiff of its brokerage commission, plaintiff should be entitled to such quasi-contractual relief. *736 See Bau v. Sobut (1977), 50 Ill. App.3d 732, 737-38, 365 N.E.2d 724; Dickerson Realtors, Inc. v. Frewert (1974), 16 Ill. App.3d 1060, 1063-64, 307 N.E.2d 445.
For the foregoing reasons, the judgment of the circuit court of Cook County is reversed and remanded.
Reversed and remanded.
STAMOS, P.J., and PERLIN, J., concur.
NOTES
[1]  Although the defendant's motion to dismiss was designated as being brought pursuant to section 48 of the Civil Practice Act (Ill. Rev. Stat. 1977, ch. 110, par. 48), the defendant does not designate upon which subsection thereof he relies. Since the defendant's motion does not allege any facts which do not appear on the face of the pleadings, we are of the opinion that the defendant's motion should have been brought pursuant to section 45 of the Civil Practice Act. Ill. Rev. Stat. 1977, ch. 110, par. 45; see Historical and Practice Notes, Ill. Ann. Stat., ch. 110, par. 48 (Smith-Hurd 1968).
