#### MIDWEST BANK AND TRUST COMPANY, Trustee, et al., Plaintiffs-Appellants, v. THE VILLAGE OF LAKEWOOD et al., Defendants-Appellees.

Second District

No. 82—573

Opinion filed April 8, 1983.

*966Daniel A. Mengeling, of Johnson and Mengeling, of Woodstock, for appellants.

Richard G. Flood and Sherry L. Holland, both of Zukowski, Poper, Rogers and Flood, of Crystal Lake, for appellees.

JUSTICE LINDBERG

delivered the opinion of the court:

Landowners’ complaint against the village of Lakewood and its president and trustees was dismissed by the trial court upon defendants’ oral motion at the commencement of the trial. Because the motion was improperly considered, we reverse the dismissal of the complaint as against the village and remand. We affirm, however, the dismissal of the complaint as against the other defendants on the basis that it failed to state a cause of action.

Plaintiffs are owners of real property in the village of Lakewood (village). Plaintiffs’ complaint alleges that the village, through its agent, had filed a notice of claim of lien with the recorder of deeds of McHenry County against their property. The complaint, alleging that no right to the lien exists, prays for a declaratory judgment to that effect, a mandatory injunction requiring removal of the lien, and compensatory and exemplary damages for the tort of slander of title. Named as defendants are the village and the following individuals (hereinafter called the trustees): Harry D. Benoy, village board president; and Jamie P. Alexander, Edward Dvorak, Fredrick Ohlrich, T. Keith Davis, Stanley Kopala, and Conrad Byrd, all village trustees.

Defendants’ answer denied liability, but did not raise any affirmative matters. On December 30, 1981, the trial court denied plaintiffs’ motion for summary judgment on the grounds that issues of fact existed as to certain allegations of the complaint, including validity of the lien in question.

On May 21, 1982, the day set for trial, defendants made an oral motion to strike and dismiss during their opening argument. Defendants contended that immunities established by the Local Governmental and Governmental Employees Tort Immunity Act (111. Rev. Stat. 1981, ch. 85, par. 1 — 101 et seq.) precluded money damages liability against them and that the equitable relief was barred by plaintiffs’ failure to join all necessary parties. The trial court on that date entered an order dismissing the entire complaint without granting leave to amend.

On June 23, 1982, the trial court denied plaintiffs’ motion for reconsideration while including the specific findings upon which it based its dismissal. On July 7, 1982, the court denied plaintiffs’ second mo*967tion for reconsideration because it was filed more than 30 days after the dismissal order. However, the court in its July 7 order did amend nunc pro tunc its May 21 dismissal order to grant leave to plaintiffs to amend their complaint. The court also found that there was no just reason for delaying the appeal of its decision dismissing the request for money damages and permitting amendment to the complaint.

On July 23, 1982, plaintiffs filed their second amended complaint, seeking only declaratory and injunctive relief, and a notice of appeal seeking reversal of the orders of May 21,1982, and June 23,1982.

On appeal, plaintiffs maintain that this is an interlocutory appeal taken only from that part of the order of dismissal pertaining to plaintiffs’ action for damages. They contend first that the trial court erred in entertaining defendants’ motion to dismiss and second, that the Local Governmental and Governmental Employees Tort Immunity Act protects neither the village nor the trustees from liability in this case. Plaintiffs do concede however, that their complaint fails to state a cause of action against the trustees and indicate their intention of amending their complaint to cure that defect upon remand.

The first issue to which we must address ourselves is the confusion concerning the scope of this appeal. Defendants’ original contention that this court should affirm the trial court’s dismissal of the portion of the complaint seeking declaratory and equitable (hereinafter called equitable) relief as well as that portion seeking money damages, presupposes that the dismissal of the equitable relief portion of the complaint has been appealed to this court. Plaintiffs, on the other hand, argue that their appeal was taken only from the dismissal of the money damages portion of their complaint. They assign error in their brief only as to the money damages part of the dismissal. Although the May 21 and June 23 orders from which this appeal is taken and plaintiffs’ June 23 notice of appeal all deal with the dismissal of the whole complaint, plaintiffs point to the following: (1) the July 7 order amending the dismissal order to grant them leave to amend their complaint and finding no just reason for delaying appeal on the damages dismissal; and (2) the July 23 filing of their amended complaint addressed only to equitable relief. Thus, plaintiffs argue, the equitable portion of their action, in the form of their second amended complaint, is still pending before the trial court and was not transferred to this court by the July 23 filing of their notice of appeal.

At oral argument, defendants indicated their desire no longer to press their position that the appeal encompasses the entire dismissal order. However, questions of jurisdiction must be raised by the reviewing court sua sponte even where the parties make no reference *968to its presence or absence. (In re Application of County Collector (1981), 95 Ill. App. 3d 1118, 420 N.E.2d 1055.) Of necessity, this court is obligated to consider matters which affect its right and duty to proceed in its exercise of appealable jurisdiction. (See Kohan v. Rimland School for Autistic Children (1981), 102 Ill. App. 3d 524, 430 N.E.2d 139.) Accordingly, we cannot ignore the invalidity of the July 7 order granting leave to amend the complaint upon which plaintiffs rely to limit the scope of this appeal.

A trial court is without jurisdiction to amend its own final order more than 30 days after the entry of that order, except by way of a nunc pro tunc order. (Bradley v. Burrell (1981), 97 Ill. App. 3d 979, 424 N.E.2d 15.) Plaintiffs’ motion requesting the amendment, as a second post-judgment motion filed more than 30 days after judgment, could not serve to extend the trial court’s jurisdiction beyond that 30-day period. (See Sears v. Sears (1981), 85 Ill. 2d 253.) The purpose of a nunc pro tunc order is to correct a prior order which incorrectly reflects the trial court’s ruling; it may not be used to supply omitted judicial action, correct judicial errors or correct prior orders. (Bradley v. Burrell.) The record clearly indicates in this case that the trial court had no intention of granting plaintiffs leave to amend until after the entry of its final dismissal order. Thus, the trial court’s July 7 amendment to the dismissal order was void.

We also note that the July 7 amendment order could not have been authorized by section 2 — 616 of the Code of Civil Procedure (111. Rev. Stat. 1981, ch. 110, par. 2 — 616), which section limits amendments to pleadings, except to conform the pleadings to the proofs, to “anytime before final judgment,” nor by section 2 — 1203 of the Code (111. Rev. Stat. 1981, ch. 110, par. 2 — 1203), which, while authorizing a motion for certain kinds of relief within 30 days after judgment, does not encompass a leave to file an amended complaint. Fultz v. Haugan (1971), 49 Ill. 2d 131; First National Bank v. City of Aurora (1978), 71 Ill. 2d 1.

Since the trial court’s leave to amend the complaint was invalid, the July 23 filing of the amended complaint was invalid as done without proper leave. An amendment to a pleading which is filed without leave of court to do so may be stricken and must be disregarded on review. (In re Marriage of Peoples (1981), 96 Ill. App. 3d 94, 420 N.E.2d 1072.) Thus, at the time of the filing of the notice of appeal, the entire complaint remained dismissed and subject to appeal.

Supreme Court Rule 303 (87 Ill. 2d R. 303) provides that the notice of appeal shall specify the judgment or part thereof from *969which the appeal is taken. When an order is severable an appeal can be taken from the severable portion or from a part dealing with a particular subject. (Layfer v. Tucker (1979), 71 Ill. App. 3d 333, 389 N.E.2d 252.) Here, the notice of appeal, while specifying particular relief, does not specify any part of the orders of May 21 and June 23 as the subject of the appeal. Without that specification and with the entirety of the complaint subject to appeal, we hold that the dismissal of the entire complaint, including that portion seeking equitable relief, is now before this court on appeal. On that basis, we proceed to the other issues.

Plaintiffs first contend that the trial court improperly considered defendants’ oral “motion to strike and dismiss.” Defendants’ motion sought dismissal of plaintiffs’ cause because plaintiffs were not entitled to relief as a matter of law. With regard to the damages portion of the complaint, defendants’ motion was based upon the statutory immunities established in the Local Governmental and Governmental Employees Tort Immunity Act (hereinafter cited as the Act) (111. Rev. Stat. 1981, ch. 85, par. 1 — 101 et seq.). The motion was made orally during the opening statements at trial. There had been no formal notice to plaintiffs of the motion.

Plaintiffs objected to the trial court’s consideration of defendants’ motion because it was not made until trial, because plaintiffs were not given notice, and because the motion was oral rather than written. Plaintiffs maintain that the defense the motion raises is in the nature of an affirmative defense and as such should have been pleaded. (See 111. Rev. Stat. 1981, ch. 110, par. 43(4).) Plaintiffs argue that the motion cannot be characterized as anything but a motion for summary judgment, and as such fails to meet the formalities requirements of that type of motion.

Defendants respond that their motion was a motion to dismiss for failure to state a cause of action and, therefore, could be raised and given consideration at any stage of the proceeding. Alternatively, defendants argue that their motion, in effect, asks leave to amend their pleadings to include the statutory immunity defense.

Thus, in order to resolve the question of the propriety of the trial court’s consideration of defendants’ motion, our analysis focuses on the characterization of that motion. To make that characterization, we refer to the three relevant sections of the former Civil Practice Act. Sections 45, 48, and 57 dealt with motions with respect to pleadings, involuntary dismissals based upon certain defects or defenses, and summary judgments, respectively. 111. Rev. Stat. 1981, ch. 110, pars. 45. 48. 57.

*970 Initially, we conclude that statutory governmental tort immunity under the Act is an affirmative defense. Although defendants are correct in stating that the defense is not one of those expressly listed in section 43(4), which requires pleading of affirmative defenses, that section does not limit its application to the expressly named defenses. Rather, it also includes “any defense which by other affirmative matter seeks to avoid the legal effect of or defeat the cause of action set forth in the complaint *** and any ground or defense, whether affirmative or not, which, if not expressly stated in the pleading, would be likely to take the opposite party by surprise ***.” (111. Rev. Stat. 1981, ch. 110, par. 43(4).) Immunity under the Act from liability for an otherwise sufficiently alleged tort fits that definition. Defendants’ argument that the defense cannot be an affirmative one in that it is statutory is shown to be meritless by the fact that section 43(4) expressly lists the Statute of Frauds (111. Rev. Stat. 1981, ch. 59, par. 1 et seq.) and other statutory matters as affirmative defenses.

We find further support for our conclusion that immunity under the Act is an affirmative defense in our supreme court’s holding in Hansen v. Raleigh (1945), 391 Ill. 536, that the benefits of the former Firemen’s Immunity Act (111. Laws 1931, at 618) must be invoked as an affirmative defense under section 43(4) and in those cases holding that the immunities created by the Act are not absolute and may be waived (First National Bank v. City of Aurora (1978), 71 Ill. 2d 1; Melbourne Corp. v. City of Chicago (1979), 76 Ill. App. 3d 595, 394 N.E.2d 1291).

Because of this conclusion, defendants’ motion should not be characterized as a section 45 motion, which in fact is what defendants try to do by asserting that the motion was based on the insufficiency of the complaint as a matter of law for failure to state a cause of action. (See 111. Rev. Stat. 1981, ch. 110, par. 45; Cain v. American National Bank & Trust Co. (1975), 26 Ill. App. 3d 574, 325 N.E.2d 799.) A complaint 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 plaintiffs to relief. (Cain v. American National Bank & Trust Co.) Here, defendants’ motion did not challenge the sufficiency of the complaint on its face, but rather raised an affirmative defense of immunity.

Because defendants’ motion seeks dismissal based on an affirmative defense, it may be viewed as a section 48 motion for involuntary dismissal. That section provides that “[defendant may, within the time for pleading, file a motion for dismissal of the action *** upon any of the following grounds. *** (i) That the claim or demand as*971serted against defendant is barred by other affirmative matter avoiding the legal effect of or defeating the claim or demand.” (III. Rev. Stat. 1981, ch. 110, par. 48.) In Russo v. Boland (1982), 103 Ill. App. 3d 905, 431 N.E.2d 1294, the court held that a motion to dismiss based upon the defense of the preemption provisions of the Employee Retirement Income Security Act (29 U.S.C. sec. 1144 (1976)) asserted no facts contradicting those in the complaint and raised as an affirmative defense a question of law so as to be a motion properly considered under subsection 48(l)(i). In Appelman v. Appelman (1980), 87 Ill. App. 3d 749, 410 N.E.2d 199, the court construed a motion to dismiss which was not specifically brought under either section 45 or section 48 to be a motion pursuant to section 48(l)(i) because it raised an affirmative matter not apparent on the face of the complaint. That is precisely the situation here.

As a section 48 motion, however, defendants’ motion was untimely. Defendants’ answer was on file and the trial of the cause was beginning when defendants’ oral motion was made. Clearly, this motion was not made “within the time for pleading,” as required by the statute. Although a trial court in its discretion may allow a defendant to withdraw an answer and then file a motion to dismiss based upon a defense not raised in the withdrawn answer (Morris v. Goldthorp (1945), 390 Ill. 186; Davidson v. Olivia (1958), 18 Ill. App. 2d 149, 151 N.E.2d 345), the motion to dismiss here was made, considered, and granted after defendants’ answer was filed and the trial had begun. Defendants at no time sought withdrawal of their answer.

It is possible, as plaintiffs argue, to characterize defendants’ motion as a motion for summary judgment. A motion for summary judgment will only be granted where the pleadings, affidavits, depositions, and other documents demonstrate that there is no genuine issue of material fact which would warrant trying the case. (111. Rev. Stat. 1981, ch. 110, par. 57; Dale v. Groebe & Co. (1981), 103 Ill. App. 3d 649, 431 N.E.2d 1107.) Although there may exist an issue of fact, the trial court, when viewing the evidence in the light most favorable to the nonmoving party, may grant summary judgment where it concludes that, as a matter of law, no liability exists. (Dale v. Groebe & Co.) Illinois law permits a defendant to file a motion for summary judgment at any time. (Florsheim v. Travelers Indemnity Co. (1979), 75 Ill. App. 3d 298, 393 N.E.2d 1223.) An affirmative defense may be raised in the motion for summary judgment even though it was not raised in pleadings. Florsheim v. Travelers Indemnity Co.; Harris Trust & Savings Bank v. Illinois Fair Plan Association (1979), 68 Ill. App. 3d 934, 386 N.E.2d 341.

*972 As a motion for summary judgment, however, defendants’ motion lacked adequate notice to plaintiffs. The record shows that defendants’ motion was made orally with no notice on record. Failure to provide notice to the opposing party and a reasonable amount of time to prepare a response precludes the granting of a motion for summary judgment. (Deaton v. Lloyd’s Jewelry Co. (1972), 7 Ill. App. 3d 926, 289 N.E.2d 123.) Although the trial court permitted plaintiffs to orally respond to defendants’ motion at the time it was made, the motion itself came without prior notice to plaintiffs, who were given no time to prepare a response.

We find no merit in defendants’ alternative argument for the propriety of the consideration of its motion to dismiss. Defendants contend that their motion may be considered in effect a motion to amend their pleadings to add the defense of tort immunity under the Act. Defendants correctly point out that subsection 46(1) (Ill. Rev. Stat. 1981, ch. 110, par. 46(1)) permitted them to move to amend their pleadings to add a new defense. Defendants also contend that section 46.1 (111. Rev. Stat. 1981, ch. 110, par. 46.1) provides that seeking a wrong remedy {i. e., dismissal rather than amendment to pleadings) in their motion is not fatal. In fact, a close reading of section 46.1 reveals that the wrong remedy it deals with is that sought in a plaintiff’s complaint rather than, as here, a defendant’s motion to dismiss. Assuming, however, that the trial court in its discretion could properly have considered defendants’ motion as a motion to amend their pleadings, the record shows that this is not what the trial court actually did. Defendants sought dismissal, and that is what the trial court granted. By granting dismissal upon the oral motion without an amendment to defendants’ answer, the trial court denied plaintiffs the opportunity to respond to the newly raised affirmative defense. Even if seeking the wrong remedy should not have been a fatal defect in defendants’ motion, the trial court’s granting of the wrong remedy is fatal upon review.

Defendants also argue that any error resulting from the trial court’s consideration in granting the motion to dismiss was harmless because plaintiffs had opportunity to investigate the newly raised affirmative defense after dismissal but before hearing on plaintiffs’ motion to reconsider the dismissal. Plaintiffs argue prejudice in that full investigation would not have been possible because discovery was not available to them after dismissal of the cause. Plaintiffs correctly note that there is no authority specifically permitting post-dismissal discovery; but neither is there authority denying use of discovery after dismissal. (See 87 Ill. 2d Rules 201 through 219); Slatten v. City of Chi *973 cago (1973), 12 Ill. App. 3d 808, 299 N.E.2d 442.) The question of permissibility of post-trial use of discovery was raised but not decided in Darrough v. White Motor Co. (1979), 74 Ill. App. 3d 560, 393 N.E.2d 122, where the court noted the lack of cases concerning the question. Thus, the permissibility of post-dismissal use of discovery appears to be an open question. We find the possible inability of plaintiffs to conduct discovery after dismissal to constitute sufficient prejudice resulting from the trial court’s error in entertaining and granting defendants’ motion without adequate notice to warrant reversal.

As we decided that the dismissal of the equitable relief portion of the complaint is also before us on appeal, we now address ourselves to the propriety of that part of the trial court’s order of dismissal. Because plaintiffs were under the mistaken belief that their appeal did not encompass the dismissal of the equitable relief portion of their complaint, they have not assigned error specifically to the trial court’s consideration of defendants’ motion to dismiss with regard to that part of their action. Although plaintiffs’ failure to argue this issue might be considered waiver (87 Ill. 2d R. 341(e)(7)), this court may, in the exercise of its responsibility for a just result, ignore considerations of waiver and decide the issue on grounds not properly argued by a party. (Hux v. Raben (1967), 38 Ill. 2d 223; Anderson v. Smith (1980), 91 Ill. App. 3d 938, 415 N.E.2d 643.) In view of plaintiffs’ understandable misconception of the scope of their appeal, we reach this issue despite the absence of argument on plaintiffs’ part.

During the May 21, 1982, proceedings before the trial court at which defendants raised their oral motion to dismiss, defendants briefly contended that plaintiffs had failed to properly join all necessary parties. The trial court’s May 21 dismissal order listed only the Act as the basis for dismissal. However, the trial court’s June 23 order denying plaintiffs’ motion for reconsideration of the dismissal included findings that the equitable relief request by the complaint required that all necessary parties be joined and that all necessary parties were not joined. Defendants concede that the Act provides no immunity from equitable relief. (111. Rev. Stat. 1981, ch. 85, par. 2— 101.) Thus, it appears that the trial court’s sole basis for dismissing the equitable relief portion of the complaint was plaintiffs’ failure to join the necessary parties.

However, joinder problems, such as failure to join necessary parties, are not grounds for dismissing the entire action or striking the complaint; rather, the proper remedy is to order the missing party be added. (Horwath v. Parker (1979), 72 Ill. App. 3d 128, 390 N.E.2d 72.) Therefore, the trial court’s dismissal of the equitable relief por*974tion of the complaint was an improper remedy and warrants reversal.

Plaintiffs’ second contention is that the trial court erred in ruling that the Act provides immunity to the village and the trustees under the facts of this case. With regard to the village, defendants argue that both section 2 — 107 (111. Rev. Stat. 1981, ch. 85, par. 2 — 107) and the interaction of sections 2 — 109, 2 — 201, and 2 — 208 (111. Rev. Stat. 1981, ch. 85, pars. 2 — 109, 2 — 201, 2 — 208) shield it from liability. In view of our determination that the motion to dismiss was improperly considered and that a remand is necessary, we do not reach the question of the Act’s application to the village’s liability on this appeal.

However, our disposition is different with regard to the trustees. Defendants contend and plaintiffs concede that, whether immunity under the Act applies or not, the complaint failed to state a cause of action against the trustees. It is well established that when a complaint has been dismissed, the dismissal will be upheld upon any basis found in the record. (White Fence Farm, Inc. v. Land & Lakes Co. (1981), 99 Ill. App. 3d 234, 424 N.E.2d 1370; Ording v. Springer (1980), 88 Ill. App. 3d 243, 410 N.E.2d 428; Keck v. Keck (1974), 56 Ill. 2d 508.) If it appears as a matter of law that the complaint fails to state a cause of action, an objection may be made to it at any time by any means and such objection may be raised for the first time on appeal. (Psyhogios v. Village of Skokie (1972), 4 Ill. App. 3d 186, 280 N.E.2d 552; Ording v. Springer.) Thus, although defendants’ motion to dismiss came too late to be properly granted as a section 48 motion and came with insufficient notice to be properly granted as a motion for summary judgment, we affirm that portion of the dismissal relating to the trustees on the basis of failure to state a cause of action as against those defendants only.

Plaintiffs contend that on remand they should be permitted to amend their complaint to state a cause of action against the trustees. Although we remand the cause as against the village, we affirm the dismissal as against the trustees. Thus, the cause against the trustees is concluded and there will be no complaint against the trustees on remand for plaintiffs to amend.

In reaching this disposition, we note that we make no further determination of the merits of plaintiffs’ action and defendants’ defenses and no determination whether defendants’ defense of immunity under the Act has in any manner been waived.

Accordingly, we affirm the dismissal of the complaint as against the defendant trustees and reverse the dismissal of the complaint as against the defendant village and remand to the circuit court of McHenry County for further proceedings not inconsistent with this *975opinion. In light of our disposition that does not reach the merits of the issues to which the challenged portions of appellees’ brief are addressed, plaintiffs-appellants’ motion to strike certain portions of appellees’ brief is denied.

Affirmed in part, reversed in part, and remanded.

SEIDENFELD, P.J., and HOPE, J., concur.