
32 Ill. App.3d 110 (1975)
336 N.E.2d 115
NATIONAL BANK OF ALBANY PARK IN CHICAGO, Plaintiff-Appellee,
v.
S.N.H., INC., Defendant-Appellant.  (STEVE CHRONIS et al., Third-Party Plaintiffs,
v.
MARY ANN BAKING COMPANY et al., Third-Party Defendants-Appellants;  LILLIAN CONTOS, Intervening Petitioner-Appellant,
v.
MARY ANN BAKING COMPANY et al., Respondents.)
No. 58524.
Illinois Appellate Court  First District (3rd Division).
September 4, 1975.
Rehearing denied October 2, 1975.
*111 *112 Klein, Thorpe, Kasson & Jenkins, of Chicago (Gerard E. Dempsey, of counsel), for appellants S.N.H., Inc., Mary Ann Baking Co., and Phil Georges.
Isidore Goodman, of Chicago, for appellant Lillian Contos.
Samuel Morgan, of Chicago, for appellee National Bank of Albany Park.
Reversed and remanded.
Mr. JUSTICE MEJDA delivered the opinion of the court:
This is an appeal from a summary judgment granted upon plaintiff's motion and from an order denying a motion by third-party defendants for rehearing and vacation of the judgment. The judgment declared the subject lease terminated and the occupancy of the premises by defendant to be on a month-to-month tenancy. The issues on appeal are whether summary judgment was properly granted and whether there was a failure to join an indispensable party. We reverse and remand.
The following pertinent facts are not in dispute. On January 1, 1961, La Salle National Bank, as trustee and lessor (Trustee), entered into a written lease with Chef Christopher, Inc., a corporation (Chef), as lessee, for a term of 10 years with an option of 10 additional years for the premises commonly known as 3400-02 West Lawrence Avenue, Chicago, Illinois, for use as a restaurant. Paragraph 8 of the lease provided, among other things:
"Lessee shall not allow or permit any transfer of this Lease or any interest under it or any lien upon Lessee's interest by operation of law, or assign or convey this Lease or any interest under it, or sublet the premises or any part thereof, or permit the use or occupancy of the premises or any part thereof by any one other than Lessee."
Paragraph 15(b) provided in part:
"* * * or if the leasehold interest of Lessee be levied upon under execution or by attached by process of law, * * * or if Lessee abandons the premises, then and in any such event *113 Lessor may * * * terminate this Lease and * * * or * * * Lessee's right to possession of the premises."
Christ Contos and Lillian Contos, his wife, were the sole stockholders of Chef. Christ Contos died in March 1969, and Chef occupied the premises and paid the rental through the month of August 1969. On May 1, 1970, the Trustee sold the building containing the leased premises to plaintiff National Bank of Albany Park in Chicago, a national banking association (Bank), which is successor-lessor to the Trustee.
Plaintiff Bank commenced proceedings by filing a verified complaint for declaratory judgment against defendant S.N.H. Inc., an Illinois corporation (S.N.H.), alleging that Chef "vacated" the premises; that S.N.H. moved into the store in October or November of 1969 as a month-to-month tenant; that on January 13, 1970, counsel for Trustee sent to counsel for S.N.H. a certain letter advising that the Trustee "must take the position that S.N.H. Inc. is occupying the premises on a month-to-month tenancy"; that on February 20, 1970, Mary Ann Baking Company, an Illinois corporation (Mary Ann), purported to assign the interest of Chef in and to the lease to S.N.H.; that on May 1, 1970, Trustee sold the building to the Bank and the Bank repeatedly notified S.N.H. that the tenancy was on a month-to-month basis only and recognized no interest of S.N.H. in the lease; that on September 10, 1970, new counsel for S.N.H. informed the Bank by letter that S.N.H. claimed to be an "assignee of an assignment of Mary Ann Bakery [sic] Company's interest under the lease of Chef Christopher, Inc."
In an unverified answer to the Bank's complaint defendant S.N.H. alleges in part that Chef did not vacate the premises, and in the alternative, admits that Chef vacated and S.N.H. entered the premises; S.N.H. denies moving in as a month-to-month tenant, and in the alternative, admits moving into the store, alleging that the Bank is estopped to deny that S.N.H. is lessee on the same terms and conditions as the lease. S.N.H. admits that on September 10, 1970, the Bank was informed by letter that S.N.H. claimed to be an assignee of Mary Ann's interest under the lease of Chef. The answer concluded with a prayer for declaratory judgment that S.N.H. has a valid and existing interest under the lease and that the lease to Chef is valid and in full force.
S.N.H. and Steven Chronis, its president, by new counsel, subsequently filed a verified third-party complaint against Mary Ann and Phil Georges, its employee and agent, which as amended alleged in part that Mary Ann was guarantor of a note from Chef to Oak Park National Bank which held a security interest in all the furniture, fixtures, equipment and supplies on the restaurant premises and that the indebtedness was also secured by an assignment of Chef's capital stock; that upon default, *114 Mary Ann purchased the fixtures and capital stock of Chef at a public sale on August 21, 1969; that Mary Ann, by Phil Georges, entered into an agreement with S.N.H. and Chronis whereby Mary Ann agreed to transfer the capital stock, fixtures, lease and other assets of Chef for $70,000; that the lease was the most essential part of the transaction; and that the third-party defendant represented that they would obtain a valid lease which would enable them to operate a restaurant on the premises, which representations were known to be false.
In the second count of the third-party complaint S.N.H. and Chronis alleged, in the alternative, that in representing that a valid lease would be conveyed, there has been a mutual mistake of law and a material failure of consideration and that third-party defendants knew, or should have reasonably known, that retailers' occupational taxes were due the State of Illinois and that if third-party plaintiffs attempted to occupy the premises under the corporate auspices of Chef the State of Illinois would attempt to collect said taxes, and have in fact brought such action; and that third-party plaintiffs therefore sought a cancellation of the agreement and damages.
The original attorneys who had formerly represented S.N.H. thereafter filed a motion to strike the third-party complaint on behalf of the third-party defendants, Mary Ann and Georges. Lillian Contos, by leave of court, intervened and filed a verified amended intervening petition which named as respondents Mary Ann, Georges, Chronis, S.N.H., Bank, and also Paul G. Kuchuris, secretary of Mary Ann, and Chef Christopher, Inc., a corporation. Lillian Contos alleged in substance the following: She and her husband operated a restaurant on the leased premises; her husband became indebted to Mary Ann, upon whose suggestion that the business be expanded her husband caused Chef to be organized, and entered into an agreement with Mary Ann that the existing indebtedness would be merged into the cost of expansion, and that the entire indebtedness would be repayable to Mary Ann at a daily rate. Chef was in fact organized, 500 shares being issued to Christ Contos and 500 to Lillian Contos. The instant lease between Chef and the Trustee was negotiated and executed; a driver for Mary Ann was entrusted with a key to the premises to facilitate early deliveries of bakery goods. Christ Contos died intestate in March 1969, leaving Lillian Contos as his only heir-at-law; she operated the business and paid rent until late August of 1969 when Mary Ann conspired with its officers and agents to deprive her of her rights as sole shareholder of Chef, by changing the lock and preventing her from entering the store. Mary Ann caused S.N.H. to be organized to take over and operate the business; the monies advanced by Mary Ann, including the prior indebtedness, were fully satisfied and released after the *115 death of Christ Contos, from insurance which Mary Ann carried, or should have carried on the life of Christ Contos to pay the indebtedness. At the time of the alleged foreclosure sale there was no existing indebtedness due and there was no valid sale of any rights of Chef under its lease. Lillian Contos further alleged that the sale of stock to Mary Ann and its sale to S.N.H. were null and void and were engineered by Mary Ann and its officers for the purpose of depriving her of her rights as a stockholder and the interest of Chef in the lease. The intervening petition concludes with a prayer for damages claimed by Lillian Contos as sole shareholder against Mary Ann, Georges, Kuchuris, Chronis and S.N.H., and further, for a declaration that the interest of the Bank is subject to the valid and subsisting lease of Chef, and that Chef is entitled to possession of the leased premises through its duly authorized officers.
Plaintiff Bank filed a motion for summary judgment against S.N.H., Chronis, Mary Ann, Georges and Contos, supported by the affidavit of counsel for the Bank. The affidavit alleged in pertinent part that Chef occupied the premises and paid the rent through August 1969, and at the end of that month vacated the premises; that no rent was paid for any of the term in the lease commencing September 1, 1969; that S.N.H. became a tenant in November of 1969 and thereafter submitted to the Trustee a new proposed lease which was rejected by letter of January 13, 1970, sent to counsel for S.N.H., stating that it was taking the position that S.N.H. was occupying the premises on a month-to-month tenancy; that Steve Chronis, president of S.N.H., at a discovery deposition on September 27, 1971, a portion of which was set forth in the affidavit, stated that Mary Ann "took over the corporation"; that Chronis was aware that the lease ran to Chef; that the attorneys for Mary Ann acted both for him and Mary Ann in negotiating for a new lease (the original attorneys who had filed an answer for S.N.H. and appeared for third-party defendants herein); that deponent had not previously seen the letter dated September 10, 1970, addressed to the original attorneys; that the intervening petition alleged no facts which would constitute a cause of action against plaintiff Bank. The affidavit concluded: "From the foregoing facts, it is apparent that" Chef did in fact abandon the premises; the lease by its terms could not be assigned or sublet; S.N.H. did not and does not claim to be an assignee of said lease but unsuccessfully attempted to obtain a new lease; Trustee and Bank have consistently taken the position that S.N.H. was a month-to-month tenant only and that S.N.H. in attempting to obtain a new lease recognized and acknowledged that it had no rights under the Chef lease.
A counteraffidavit pursuant to Supreme Court Rule 191(b) (Ill. Rev. Stat. 1973, ch. 110A, par. 191(b)), executed by one of the attorneys of *116 record for Mary Ann and Georges, third-party defendants, was filed; it stated that prior to March 1969 Lillian Contos and Christ Contos executed an irrevocable stock power and owner's consent for all of the stock in Chef to Oak Park National Bank in connection with a loan made to Chef; that the shares of stock were purchased by Mary Ann at a foreclosure sale on August 21, 1969; in September of 1969 Mary Ann, as owner of the stock, paid to the rental agent of Trustee the rent due from Chef under the lease; that subsequently, Mary Ann transferred the shares of stock in Chef to S.N.H. which, as owner of the stock, continued to operate the restaurant business of Chef on the premises; that during the time Mary Ann owned the stock it possessed a key, and an agent of Mary Ann's went daily to the premises which were not abandoned; during that period of time no demand was made by Trustee upon Mary Ann to surrender the key or vacate the premises; that the lease has never been surrendered to or canceled by the Trustee, and that $1,100 deposited by Chef as security under said lease has never been refunded; that S.N.H. became owner of the stock and continued to operate Chef's restaurant business on the premises and has paid the rent due from Chef commencing September 1, 1969; and that S.N.H. and Chronis have always maintained that Chef is the lessee under the lease and has been and is in possession of the premises.
Lillian Contos filed a counteraffidavit in response to plaintiff's motion for summary judgment in which she incorporated by reference the matters stated in her verified amended intervening petition. Upon a hearing the trial court sustained plaintiff's motion for summary judgment and entered judgment that the lease of Chef has been terminated and is of no force or effect as against plaintiff Bank, and that S.N.H. has no interest of any kind in and to said lease and is now occupying the premises as a month-to-month tenant only. It was further ordered that all parties other than the Bank may file amended pleadings on or before September 29, 1972.
Mary Ann and Georges, third-party defendants, filed a motion for rehearing and vacation of order of summary judgment and obtained leave of court to file counteraffidavits of Georges, Contos and Chronis, and also a memorandum of law in support of said motion. The counteraffidavits supplemented and confirmed the allegation made in the prior counteraffidavit filed pursuant to Supreme Court Rule 191(b). Georges' counteraffidavit further stated that subsequent to August 21, 1969, S.N.H. as owner of the Chef stock continued to operate the restaurant business of Chef on the premises except for a brief period of time during which the premises were being remodeled. Upon hearing, the trial court entered an order denying said motion and found no just reason for delaying enforcement *117 or appeal of the order. Notices of appeal from the summary judgment and the subsequent order were filed by Mary Ann and Georges, third-party defendants, and by S.N.H., defendant, and by Lillian Contos, intervening petitioner. S.N.H., Mary Ann and Georges, all represented by the original attorneys for S.N.H., filed a joint brief on appeal contending that the grant of summary judgment was improper in that the pleadings and affidavits disclosed the existence of genuine issues of material fact. Lillian Contos, by separate counsel, in addition to adopting the foregoing argument, further contends that the trial court erred in declaring the lease terminated because Chef, the original lessee, had not been made a party to the complaint for declaratory judgment.
 1 The first issue raised by this appeal is whether the trial court properly entered summary judgment for plaintiff. The summary judgment procedure provided in section 57 of the Illinois Civil Practice Act (Ill. Rev. Stat. 1973, ch. 110, par. 57) authorizes the entry of a judgment for the moving party only if there is no genuine issue as to any material fact and the movant is entitled to the judgment as a matter of law. (Lundin v. Egyptian Construction Co. (1975), 29 Ill. App.3d 1060, 331 N.E.2d 208. See also Greenwood v. Leu (1973), 14 Ill. App.3d 11, 302 N.E.2d 359; and Kobus v. Formfit Co. (1966), 35 Ill.2d 533, 221 N.E.2d 633.) As stated in Lundin: "When ruling on a motion for summary judgment, the court must construe the pleadings, exhibits and affidavits included therein strictly against the moving party." (29 Ill. App.3d 1060, 1063.) Any doubt as to the right of the moving party to entry of a summary judgment should be resolved by trial rather than by summary judgment. (Wegener v. Anna (1973), 11 Ill. App.3d 316, 296 N.E.2d 589.) "The only function of the court, when presented with a motion for summary judgment, is to determine if a genuine issue exists as to a material fact; if not, summary judgment is proper; if so, summary judgment is improper, as the court may not summarily determine a material fact issue." Yuhas v. Allis-Chalmers Distribution Service Corp. (1973), 12 Ill. App.3d 814, 824, 299 N.E. 2d 166.
In the instant case, plaintiff first alleged in its complaint that S.N.H. claimed to be lessee of the premises by virtue of an assignment of the lease and then alleged upon motion for summary judgment that S.N.H. never claimed to be an assignee of the lease. On the other hand, S.N.H. in its answer denied moving into the store as a month-to-month tenant and then, pleading in the alternative (Ill. Rev. Stat. 1973, ch. 110, par. 43(2)), admitted doing so and further stated that plaintiff was estopped to deny that S.N.H. was the lessee on the lease terms. Attached to plaintiff's complaint is an assignment dated February 20, 1970, executed by Mary Ann in its own corporate capacity, which recites:

*118 "For value received, MARY ANN BAKING COMPANY, an Illinois corporation, as purchaser of the capital stock of Chef Christopher, Inc. at the foreclosure sale held on August 21, 1969, * * * does hereby assign all right, title and interest in and to a certain Lease [lease herein] to S.N.H., INC., an Illinois corporation, its successors and assigns, together with Certificate Number 1 for 500 shares of stock of Chef Christopher, Inc. standing in the name of Christ Contos and Certificate Number 2 for 500 shares of stock of Chef Christopher, Inc. standing in the name of Lillian Contos."
Thereafter, on plaintiff's motion for summary judgment, S.N.H. in its counteraffidavit claimed to have occupied and operated the store under the corporate entity of Chef Christopher, alleging ownership of the latter corporation.
The factual issues became more clearly evident and contested as the intervening petitioner, Lillian Contos, contended that the sale by Oak Park National Bank to S.N.H. was invalid and in violation of her rights in Chef and that the rights of plaintiff Bank are subject to the lease rights of Chef.
The preliminary question is whether Chef violated the prohibitions of the lease or did any other act which would give plaintiff the rights to possession of the premises. It is argued by plaintiff on appeal that Chef either abandoned the premises, surrendered the lease, or voluntarily permitted the transfer of its lease by assignment or operation of law in contravention of the terms of the lease.
 2 If a tenant has allowed a third person to take possession of a leasehold and assert the latter's right to possession against the landlord, the original lessee will be considered to have abandoned the premises. (Ebersol v. Trainor (1898), 81 Ill. App. 645.) Whether or not the original lessee intended to abandon the premises is usually a question of fact to be determined upon a trial (Hopwood v. Green (1941), 310 Ill. App. 411, 34 N.E.2d 559), and likewise, the surrender and acceptance of a lease are factual questions. (Peirce v. Conant (1964), 47 Ill. App.2d 294, 198 N.E.2d 555.) Controverted issues of fact were here raised by the pleadings and affidavits as to Chef's abandonment or surrender and as to the plaintiff's acceptance of the surrender. The claim of intervening petitioner that Chef was prevented from occupying the premises and paying the rent presents additional facts to be considered in determining whether or not an abandonment or surrender took place. These matters present factual issues which must be determined by trial.
 3 Further material issues of fact are whether Chef violated the lease provisions which prohibit any assignment or transfer, including a transfer *119 under any lien upon its interest "by operation of law." The primary questions presented are whether Mary Ann did acquire the leasehold interest of Chef, and also whether S.N.H. did acquire such interest from Mary Ann. In its pleadings and affidavits S.N.H. states that it has continued to operate the business of Chef and has paid the rent due from said corporation on the leased premises by virtue of its purchase of the entire corporate stock from Mary Ann. Mary Ann has alleged that it acquired all of the shares of stock of Chef and sold them to S.N.H. and Chronis in August of 1969. Plaintiff argues on appeal that ownership of stock in a corporation does not confer upon its stockholders the property, contractual or leasehold rights of the corporation. S.N.H. concedes the principle of law thus stated. As a lessee, a corporation by its very nature stands in a different position than a natural person; each in itself constitutes a complete and separate legal entity. When a corporation transfers all of its stock, the control of the corporation is also transferred, but the legal entity of the corporate lessee remains the same. See Associated Cotton Shops v. Evergreen Park Shopping Plaza (1960), 27 Ill. App.2d 467, 476, 170 N.E. 2d 35.
S.N.H. contends that Chronis and S.N.H. have at all times acted as agents of Chef and not as owners of the property or of the leasehold rights in its stead. The facts therein are in dispute. The contested issues to be determined upon trial are whether the possession of the premises and the operation of the business were by S.N.H. and Chronis, solely on their own behalf, or as agents of Chef in the latter's corporate capacity.
Plaintiff Bank further argues that Mary Ann's acquisition of the stock through a foreclosure sale resulted in an immediate termination of the lease in that paragraph 15(b) of the lease provides in pertinent part that "if the leasehold interest of Lessee be levied upon under execution or be attached by process of law" the lessor may elect to terminate the lease and lessee's right to possession or lessee's right to possession only. There is no contention that the leasehold itself was impressed with a lien or that Oak Park National Bank levied upon or attached such leasehold interest of Chef. On the contrary, the pleadings and affidavits set forth that Oak Park National Bank had a security interest in the furniture, fixtures, equipment, supplies and capital stock of Chef [not the lease itself] and that Mary Ann purchased the foregoing capital stock at a foreclosure sale of the security interest and subsequently sold it to S.N.H. and Chronis. Neither is there any allegation that Oak Park National Bank became the shareholder and assigned the lease to Mary Ann. A foreclosure sale of shares of stock is made upon the interest of the stockholder and is not thereby made upon the leasehold interest of the corporation involved. It follows that the leasehold interest was not "levied upon under execution *120 or attached by process of law" within the foregoing lease provisions.
In Associated Cotton Shops v. Evergreen Park Shopping Plaza we stated (27 Ill. App.2d 467, 475, 476) that provisions in a lease are generally strictly construed against a lessor and that the ordinary provisions in a lease prohibiting assignments or subletting do not apply where the stockholders or corporate lessees dispose of all their stock. We there recognized that a lease may by express provision prohibit the sale of corporate stock when it changes the control of the corporation. The foregoing principles apply with equal force to the instant case. Here the lease did not provide any prohibition as to the sale or transfer of the stock ownership of the original corporate lessee. The contention of S.N.H., although controverted by plaintiff Bank, is that the corporate ownership of Chef was purchased by Mary Ann and thereafter by S.N.H., and was not an assignment or subletting of the lease itself. In addition to determining the issue as to the validity of the foreclosure sale, the subject matter and scope of the foreclosure sale and the transfers thereunder present genuine issues of material fact to be determined by trial. If the determination upon remand is that the acquisition was of the stock and not in contravention of the rights of the intervening petitioner, such transfer would not authorize a termination at the election of the lessor within the provisions of paragraph 15(b) of the lease. In such event, the leasehold rights would remain in Chef as an entity distinct from the transferee of its stock. We do not intend hereby to express any opinion as to the merits of the contentions presented.
 4 In the other issue presented, intervening petitioner Lillian Contos contends that the summary judgment should be reversed for the further reason that Chef Christopher, Inc., a corporation, was a necessary party and has not been made a party to plaintiff's complaint for declaratory judgment. Plaintiff Bank responds that all of the real parties in interest were before the trial court and are now before this court; and that in any event, Chef Christopher, Inc., was and is a respondent named by the intervening petitioner in her petition. After a careful examination of the record in this court, although named as a respondent as contended, we find no service of process or appearance, pleading or proceeding to evidence jurisdiction over the corporate entity. The general rule is that all persons materially interested in the subject or object of the action, or having or claiming equitable rights in the subject matter, must be made parties to an action to cancel an instrument so that all interests may be provided for and protected by the decree. (Georgeoff v. Spencer (1948), 400 Ill. 300, 302, 79 N.E.2d 596, 6 Ill. L.&Pr. Cancellation of Instruments § 20, at 182 (1954).) A necessary party is one who has such an interest in the matter in controversy that it cannot be determined without either *121 affecting that interest or leaving the interest of those who are before the court in a situation that might be embarrassing and inconsistent with equity. Ragsdale v. Superior Oil Co. (1968), 40 Ill.2d 68, 71, 237 N.E.2d 492.
 5, 6 Whenever a party has been omitted whose presence is so indispensable to a decision of the case upon its merits that a final decree cannot be made without materially affecting his interests, the court should not proceed to a decision on the merits. The objection may be made by a party at the hearing or on appeal, and the court will upon its own motion take notice of the omission and require the omitted party to be made a party to the litigation even though no objection is made by any party litigant. (Hobbs v. Pinnell (1959), 17 Ill.2d 535, 536, 162 N.E.2d 361.) The requirement of "joinder" of necessary parties is absolute and inflexible and applies to trial courts as well as to appellate courts which have a duty to enforce this principle of law sua sponte as soon as it is brought to their attention. It is error to proceed to hearing and disposition on the merits without jurisdiction of the necessary parties. (Glickauf v. Moss (1974), 23 Ill. App.3d 679, 683, 320 N.E.2d 132.) The test of whether a corporation is a necessary party is if it is "legally or beneficially interested in the subject matter of the litigation" so that it would "be affected by the decree" (23 Ill. App.3d 679, 682) and this conclusion cannot be avoided or altered by the presence before the court of all the shareholders of the corporation, although the rule may be relaxed where a party already present effectively represents the omitted interest (page 683).
While a finding in the instant case that a binding and valid assignment of Chef's lease rights may ultimately indicate that such corporation was a dispensable party by reason of having no further interest in the proceedings, the question of whether such an assignment has in fact been effected and is valid remains to be determined in these proceedings. The requirement of necessary parties described as "fundamental doctrine" is not affected by the fact that the order appealed from may represent an outcome favorable to the absent corporation (see 23 Ill. App.3d 679, 683, 684).
 7 These proceedings sought to directly adjudicate the rights of Chef as lessee and as a separate corporate entity. Plaintiff Bank on oral argument has suggested that Chef was dissolved during the pendency of the within action for failure to pay franchise taxes. However, the dissolution of a corporation does not take away or impair any remedy available to or against such corporation, and any such action by or against the corporation may be prosecuted or defended within 2 years of such dissolution by the corporation in its corporate name. (Ill. Rev. Stat. 1973, ch. 32, par. *122 157.94.) A final adjudication upon the merits cannot be made without materially affecting the interest of the corporation, and the corporation is therefore a necessary and indispensable party. This omission further requires that the judgment and order of the trial court be reversed. Upon remand, the appropriate steps must be taken to obtain jurisdiction of Chef Christopher, Inc., a corporation, or its legal successors before a hearing on the merits may be had.
For the foregoing reasons, the summary judgment and the order denying rehearing and the vacation of the order of summary judgment are reversed and the cause is remanded for further proceedings not inconsistent with the views expressed herein.
Reversed and remanded.
McGLOON, P.J., and McNAMARA, J., concur.
