
835 N.E.2d 387 (2005)
358 Ill. App.3d 1063
296 Ill.Dec. 353
PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
William COLEMAN, Defendant-Appellant.
Nos. 3-03-0295, 3-03-0493.
Appellate Court of Illinois, Third District.
April 29, 2005.
As Modified Upon Denial of Petition for Rehearing August 4, 2005.
*388 G. Joseph Weller (Court-appointed), Paul J. Glaser (argued), Office of the State Appellate Defender, Elgin, for William Coleman.
Lawrence M. Bauer, Deputy Director, State's Attorneys Appellate Prosecutor, Ottawa, Kevin W. Lyons, State's Attorney, Peoria, Terry A. Mertel (argued), State's Attorneys Appellate Prosecutor, Ottawa, for the People.

Modified Upon Denial of Petition for Rehearing
Justice McDADE delivered the opinion of the court:
In this case from the circuit court of Peoria County, the defendant, William Coleman, appeals from the summary dismissal of his postconviction petition and his motion for relief from judgment pursuant to section 2-1401 of the Code of Civil Procedure (735 ILCS 5/2-1401 (West 2002)). In the trial from which the petitions arise, the defendant was charged with and found guilty of unlawful possession of a controlled substance with the intent to deliver and the unlawful possession of heroin. His conviction was subsequently affirmed by this court on direct appeal. On collateral review, the defendant's postconviction petition was dismissed as frivolous and patently without merit, and on the basis that it was barred by res judicata. The section 2-1401 motion was also dismissed as barred by res judicata. The defendant appeals. We affirm in part, reverse in part and remand for further proceedings.

FACTS
The underlying facts show that the defendant was present at a house at 1507 West Butler Street in Peoria when the police executed a search warrant. Upon *389 execution of the warrant, the police discovered a significant quantity of crack cocaine, heroin, plastic baggies, and a sizable sum of money in small denomination bills. In the garage, the police discovered a rented car in which was found a utility bill for the house with the defendant's name listed as the resident.
The search warrant for the house was supported by an affidavit that asserted that a confidential informant had been present in the house several times in the month leading up to the search and that the house contained illegal contraband.
Following his conviction, the defendant appealed pro se, arguing that the trial judge should have recused himself, that he was not guilty beyond a reasonable doubt, that his possession charge was improperly enhanced from a class 1 to a class X felony, that he was entitled to monetary credit against his drug assessment for time served prior to trial, and that his trial counsel was ineffective for failing to move to suppress the evidence seized during the execution of the search warrant. This court affirmed the conviction, but awarded the monetary credit. People v. Coleman, No. 3-01-0539 (2003)(unpublished pursuant to Supreme Court Rule 23).
The defendant has now filed a petition for postconviction relief in which he asserts that the officer who wrote the affidavit in support of the search warrant invented the confidential informant and argues that his trial counsel was ineffective for failing to challenge the affidavit. He has also filed a motion for relief from judgment, pursuant to section 2-1401 of the Code of Civil Procedure (735 ILCS 5/2-1401 (West 2002)), in which he challenges his arrest and search of the house on West Butler. He also asserts in that motion that the investigative officer gave false testimony to the grand jury and that the police failed to weigh the contraband found during the search.
The trial court summarily dismissed the post conviction petition as frivolous and patently without merit, on the basis that the defendant waived the issues presented in the petition since they were not pursued on direct appeal. On motion of the State, the court also dismissed the section 2-1401 motion, in an ex parte proceeding, finding that the claims raised were barred by res judicata. There is no indication in the record that the defendant was served with the State's motion. The defendant now appeals the dismissal of those petitions.

ANALYSIS

I. Postconviction Petition Claim
The defendant alleged in his postconviction petition that he was denied effective assistance of counsel because his lawyer at trial did not challenge the legality of the search of the house on 1507 West Butler. Specifically he claims that the officer who filed for the search warrant for the residence falsified the existence of a confidential source in the supporting affidavit. The trial court summarily dismissed the petition as patently frivolous. On appeal, the defendant argues that the summary dismissal of the petition was inappropriate and that the court should have held an evidentiary hearing on the matter. The State argues that the defendant's claims in the petition are barred by res judicata and that the defendant has failed to produce an affidavit or any other evidence to support his claim about the alleged fabrication of the confidential informant. We will review the summary dismissal of defendant's postconviction petition de novo. People v. Coleman, 183 Ill.2d 366, 233 Ill.Dec. 789, 701 N.E.2d 1063 (1998).
*390 To receive postconviction relief, the defendant must prove a substantial deprivation of federal or state constitutional rights in the underlying trial. People v. Morgan, 187 Ill.2d 500, 528, 241 Ill.Dec. 552, 719 N.E.2d 681, 697 (1999). However, the claims that the defendant may raise are limited by res judicata; those claims that have or could have been litigated previously on direct appeal are barred. People v. Winsett, 153 Ill.2d 335, 346, 180 Ill.Dec. 109, 606 N.E.2d 1186, 1193 (1992).
In his current petition, the defendant challenges the sufficiency of the warrant authorizing the search of the house in which the defendant and the illegal drugs were found. The defendant challenged the constitutionality of the search on other grounds in his direct appeal. In that appeal, this court found that the defendant did not have standing to challenge the search, because he was a transitory visitor to the house. People v. Coleman, No. 3-01-0539 (2003)(unpublished order under Supreme Court Rule 23). This issue, having been litigated previously, now acts as a bar to the defendant's claim in his present postconviction review petition. Since the defendant's petition was barred by a finding of lack of standing, we will not consider the defendant's other claim related to the petition. It was not error for the trial court to summarily dismiss the petition.

II. Section 2-1401 Motion Claim
The defendant also argues that it was error for the trial court to dismiss his section 2-1401 motion for relief from judgment in an ex parte proceeding when the defendant had not received notice of or been served with the State's motion to dismiss the petition.
Section 2-1401 of the Code of Civil Procedure (735 ILCS 5/2-1401 (West 2004)) provides a comprehensive statutory procedure through which final orders, judgments and decrees may be challenged more than 30 days after their entry. People v. Pinkonsly, 207 Ill.2d 555, 562, 280 Ill.Dec. 311, 802 N.E.2d 236, 241 (2003). In considering a section 2-1401 motion, the court must determine whether facts exist that were unknown to the court at the time of trial and would have prevented entry of the judgment. Pinkonsly, 207 Ill.2d at 566, 280 Ill.Dec. 311, 802 N.E.2d at 243. We review the dismissal of the defendant's motion under the section for an abuse of discretion. Pinkonsly, 207 Ill.2d at 562, 280 Ill.Dec. 311, 802 N.E.2d at 241. However, in this case, we examine whether the court has followed the applicable statutory procedure, and we will review the issue de novo. People v. Shellstrom, 345 Ill.App.3d 175, 176, 280 Ill.Dec. 456, 802 N.E.2d 381, 383 (2003).
We note, initially, that we believe the defendant's motion suffers from the same fault as his postconviction petition: the claims therein are barred by res judicata because they could have been raised on direct appeal. We examine here whether the disposition of defendant's motion was procedurally correct.
The State argues that the dismissal was proper, relying on a number of cases that have found that the summary dismissal of a section 2-1401 petition is not error. People v. Taylor, 349 Ill.App.3d 718, 720, 285 Ill.Dec. 761, 812 N.E.2d 581, 583 (1st Dist.2004); People v. Bramlett, 347 Ill. App.3d 468, 472-73, 282 Ill.Dec. 663, 806 N.E.2d 1251, 1254-55 (4th Dist.2004). Since this case was briefed, three more cases have been decided that have found similarly. People v. Dyches, 355 Ill.App.3d 225, 291 Ill.Dec. 780, 824 N.E.2d 636 (1st Dist.2005); People v. Schrader, 353 Ill. App.3d 684, 687, 289 Ill.Dec. 713, 820 N.E.2d 489, 494 (1st Dist.2004); People v. Anderson, 352 Ill.App.3d 934, 947, 288 Ill. Dec. 350, 817 N.E.2d 1000, 1011 (1st Dist. 2004).
*391 In contrast, a number of other cases have found summary dismissal unlawful. People v. Mescall, 347 Ill.App.3d 995, 1000, 283 Ill.Dec. 813, 808 N.E.2d 1101, 1106 (2nd Dist.2004); People v. Winfrey, 347 Ill.App.3d 987, 988, 283 Ill.Dec. 623, 808 N.E.2d 589, 590 (2nd Dist.2004) (finding against summary dismissal of habeas corpus petition); People v. Shellstrom, 345 Ill.App.3d 175, 177, 280 Ill.Dec. 456, 802 N.E.2d 381, 384 (2nd Dist.2003) (finding against summary dismissal of mandamus petition), appeal allowed 208 Ill.2d 552, 284 Ill.Dec. 345, 809 N.E.2d 1291 (2004); People v. Pearson, 345 Ill.App.3d 191, 196, 280 Ill.Dec. 461, 802 N.E.2d 386, 391 (2nd Dist. 2003), appeal allowed 208 Ill.2d 549, 284 Ill.Dec. 344, 809 N.E.2d 1290 (2004); People v. Gaines, 335 Ill.App.3d 292, 296, 269 Ill.Dec. 350, 780 N.E.2d 822, 824 (2nd Dist. 2002).
In People v. Gaines, the court rejected the State's argument that a section 2-1401 motion could be treated, procedurally, like a postconviction petition. In that case, the trial court dismissed the defendant's section 2-1401 motion after considering a motion to dismiss filed by the State, and did not provide the defendant notice of the state's motion and did not allow the defendant a meaningful chance to be heard on the matter. Gaines, 335 Ill.App.3d at 296, 269 Ill.Dec. 350, 780 N.E.2d at 825. The court found that the procedures used to dispose of the defendant's motion did not conform to the procedural requirements of Section 2-1401.
Unlike proceedings on a postconviction petition, which allow the summary dismissal of a petition by the court if it is found to be "frivolous or patently without merit" (725 ILCS 5/122-2.1(a)(2)(West 2004)), section 2-1401 does not provide for an independent examination of the motion by the trial court, and the court is not authorized by section 2-1401 to summarily dismiss a motion brought pursuant to the provision. Gaines, 335 Ill.App.3d at 296, 269 Ill.Dec. 350, 780 N.E.2d at 825. The court in Gaines did not consider the merits of the defendant's motion, but concluded that the process followed by the trial court, in dismissing the motion without notice or a hearing, was "seriously flawed" and that "basic notions of fairness dictate that the defendant be afforded notice of, and an opportunity to respond to, any motion or responsive pleading by the State." Gaines, 335 Ill.App.3d at 296, 269 Ill.Dec. 350, 780 N.E.2d at 825.
The second district revisited the issue in People v. Pearson. In that case, the court reasserted its conclusion that a summary dismissal of a section 2-1401 motion by the trial court was not allowed by statute. The situation in Pearson differed from that in Gaines in two respects. First, the dismissal in Pearson was not the result of a pleading by the State. Second, unlike in Gaines, the court in Pearson considered the merits of the defendant's motion and concluded that the defendant's claims were meritless and that the "trial court would almost certainly dismiss defendant's petition after proper proceedings." Pearson, 345 Ill.App.3d at 196, 280 Ill.Dec. 461, 802 N.E.2d at 390. Despite its conclusion that the defendant was not harmed by the summary dismissal of his motion, the court found that "the procedures by which the trial court dismissed [the motion] was simply too far removed from what the defendant was entitled to for [the court] to review the matter as if defendant had been given notice and an opportunity to answer." Pearson, 345 Ill.App.3d at 196, 280 Ill.Dec. 461, 802 N.E.2d at 391.
The approach taken by Gaines and Pearson contrasts with the analyses of the issue in People v. Taylor and People v. Bramlett. In Bramlett, the Fourth District found that, despite the fact that there *392 is no explicit authorization for summary dismissal in section 2-1401, the trial court nevertheless has the power to dismiss a section 2-1401 petition, which derives from the trial court's "`inherent authority to control [its] courtroom and [its] dockets'" and its "`corollary authority to utilize [its] discretion in dealing with "professional litigants" who inappropriately burden the court system with nonmeritorious litigation, stemming from their unhappiness as DOC inmates.'" Bramlett, 347 Ill.App.3d at 472, 282 Ill.Dec. 663, 806 N.E.2d at 1254, quoting Mason v. Snyder, 332 Ill. App.3d 834, 842, 266 Ill.Dec. 351, 774 N.E.2d 457, 463-64 (2002).
In Taylor, the First District affirmed the summary dismissal of the defendant's section 2-1401 motion. The court did not decide the question whether in every case the trial court has the authority to summarily dismiss a section 2-1401 motion but, rather, differed with the court in Pearson on whether such a dismissal could be considered harmless error if the defendant's petition was clearly without merit. Taylor, 349 Ill.App.3d at 720, 285 Ill.Dec. 761, 812 N.E.2d at 583-84. The court reasoned that the defendant was not prejudiced by the dismissal, because the petition was clearly frivolous and would have been dismissed even if the defendant had been afforded notice and an opportunity to be heard, and that a reversal and remand would have "little remedial effect and would only delay dismissal." Taylor, 349 Ill.App.3d at 721, 285 Ill.Dec. 761, 812 N.E.2d at 584.
In contrast to Taylor, the court in Anderson found explicitly that it was error for the trial court to summarily dismiss a section 2-1401 motion. The court agreed that it was "unfair for a litigant to be deprived of notice of the proposed dismissal of his action and an opportunity to respond, whether the dismissal is initiated by another litigant or a court." Anderson, 352 Ill.App.3d at 942, 288 Ill.Dec. 350, 817 N.E.2d at 1006-07. Nevertheless, the court found that it was appropriate to apply the harmless error doctrine and affirm the dismissal. In reaching this conclusion, the court agreed with the court in Taylor that in cases where the defendant's pleading is incurably deficient and eventual dismissal is inevitable, "further proceedings in the trial court `would have little remedial effect and would only delay dismissal.'" Anderson, 352 Ill.App.3d at 948, 288 Ill. Dec. 350, 817 N.E.2d at 1011, quoting Taylor, 349 Ill.App.3d at 721, 285 Ill.Dec. 761, 812 N.E.2d at 584.
After considering the relevant authorities, we find that the dismissal here was improper. We agree with the court in Anderson that there is an important policy consideration that weighs against finding the practice is not error: summary dismissal may prevent a defendant from amending a defective pleading. Anderson, 352 Ill.App.3d at 944, 288 Ill.Dec. 350, 817 N.E.2d at 1009. As the court observed, although "`a claim may be entirely spurious on its face, the court cannot know, without hearing the parties, whether the plaintiff may be able to amend the * * * [pleading] sufficiently to state a claim entitling the plaintiff to relief.'" Anderson, 352 Ill.App.3d at 944, 288 Ill.Dec. 350, 817 N.E.2d at 1008, quoting Huminski v. Lavoie, 173 Vt. 517, 519, 787 A.2d 489, 492 (2001).
More importantly, however, we do not believe summary dismissal is permissible as a matter of statutory construction. It is clear that section 2-1401 does not provide for summary dismissal by a trial court. As noted in Anderson, "[i]t is a time-honored principle that `courts can only declare the law as they find it, and follow it as it is. The Legislature alone can make new laws or change * * * rules of procedure.'" *393 Anderson, 352 Ill.App.3d at 945, 288 Ill.Dec. 350, 817 N.E.2d at 1009, quoting People v. Northup, 279 Ill.App. 129, 150 (1935). We believe that had the legislature intended for section 2-1401 motions to be dismissed summarily, it would have provided a mechanism for the court to do so, as was done in the Post-conviction Hearing Act. The legislature did not do so. Therefore, relying strictly on the language of the statutes, a section 2-1401 motion should not be treated like a postconviction petition.
An additional consideration in this case, however, is the fact that the dismissal was ordered in response to a motion from the State. Because of this added element, what happened below did not conform with the procedure of the Post-conviction Hearing Act, where the court's disposal of the petition as frivolous or patently without merit must come without input from either party. The court had allowed the State to file a motion to dismiss and had scheduled it for a hearing, indicating that it would not hear oral argument at that hearing. The court believed, incorrectly as it turns out, that the defendant had been provided accurate notice of the hearing and may also have believed that he had been served with the State's motion. There is no proof of service or other documentation that the State sent the motion to the defendant. The final order of the circuit court showed the State present for "Hearing held on People's Motion to Dismiss D's Petition for Relief from Judgment," indicated that defendant was "in IDOC" and "ordered" that "[t]he People's Motion to Dismiss is granted. Motion (sic) dismissed." It thus appears from the court's record that the Petition was dismissed on the basis of the State's motion without an opportunity for the defendant to respond or be heard.
Such a situation is inimical to our tradition of due process. Even under the Post-conviction Hearing Act, it is improper for the trial court to summarily dismiss the defendant's petition after it has received a responsive pleading by the State. We are unwilling to find in the present situation that it is proper for the court to ignore the requirements of statute, hold a hearing on a motion with which the defendant was not served and to which he had no opportunity to respond, consider the written arguments of an adversarial government, and dismiss the defendant's case without his having had a meaningful opportunity to be heard on the matter. That strikes us as a step too far in the wrong direction.
We also decline the State's invitation to treat the summary dismissal of the defendant's motion as harmless error. We disagree with the findings in Taylor and Anderson that such a glaring breach of procedure can ever be harmless. Instead, we think that the evaluation of the court in Shellstrom is correct, that "[the] trial court's failure to give a nonmovant notice and an opportunity to respond to a dispositive motion is inherently prejudicial." Shellstrom, 345 Ill.App.3d at 179, 280 Ill. Dec. 456, 802 N.E.2d at 386. Although we did not find merit in the defendant's motion, we believe that he was nevertheless entitled to the process guaranteed him by statute. We believe it is valuable to promote efficiency in our courts, but we also believe it is valuable to promote adherence to the rules set forth by our statutes. In balancing these two interests, which are often in conflict, we find that in this case, it is important to stand on the side of due process, even at the cost of some inefficiency.
The court in Bramlett argued that to deny the courts the power to summarily dismiss frivolous section 2-1401 motions would cede control of the docket to jailhouse lawyers and other repeat filers of nonmeritorious pleadings. Bramlett, 347 *394 Ill.App.3d at 472, 282 Ill.Dec. 663, 806 N.E.2d at 1254. We concede that frivolous motions are often filed and that it would be easier to dispose of them if the court were allowed to dismiss them summarily. Nonetheless, we are convinced that it is not the role of the courts to adopt that right in the absence of statutory authority to do so, especially since the defendant's remedy itself is a creature of statute. The legislature is the body best able to weigh the concerns of public policy that might warrant allowing summary dismissal of section 2-1401 motions and to provide for it, if necessary. The legislature has at this point declined to do so, and in the absence of any guidance to the contrary, we must continue to follow the procedures that the legislature has thus far delineated. Cf. Shellstrom, 345 Ill.App.3d at 178, 280 Ill. Dec. 456, 802 N.E.2d at 385 ("The procedural framework of mandamus actions is not a policy issue for the courts to decide but, rather, a legislative decision to be made by the general assembly. Accordingly, it is the province of the legislature, not the judiciary, to amend the statute to allow for summary dismissals"). As we have already noted, the existing procedure does not include a provision for summary dismissal. We therefore find that it was error for the trial court to dismiss the defendant's section 2-1401 motion, and we remand the case for further proceedings.

CONCLUSION
The defendant's claims in his post conviction petition were claims that could have been raised in his direct appeal of his conviction. Since they could have been raised earlier, but were not, they are barred by res judicata. It was therefore not error for the trial court to dismiss the motion. However, the trial court did err in granting, ex parte, the motion to dismiss the defendant's section 2-1401 motion when the defendant had not received notice of that motion. The dismissal of that motion should be reversed and the case remanded for further proceedings.
Affirmed in part; reversed and remanded in part.
LYTTON and BARRY, JJ., concur.
