
751 N.E.2d 1257 (2001)
322 Ill. App.3d 958
256 Ill.Dec. 420
The PEOPLE of the State of Illinois, Plaintiff-Appellant,
v.
Charles BENTON, a/k/a Charles Benton-Bey, Defendant-Appellee.
No. 3-00-0598.
Appellate Court of Illinois, Third District.
June 22, 2001.
*1258 John X. Breslin, Deputy Director, State's Attorneys Appellate Prosecutor, Ottawa, Marshall E. Douglas, State's Attorney, Rock Island, Richard T. Leonard, Ottawa, for the People.
Charles A. Benton, Davenport, for Charles A. Benton.
*1259 Presiding Justice HOMER delivered the opinion of the court:
Defendant Charles Benton, also known as Charles Benton-Bey, was charged with operating an uninsured motor vehicle (625 ILCS 5/3-707 (West 1998)). At defendant's first appearance, the trial court dismissed the case on its own motion, holding that Illinois' mandatory liability insurance law does not apply to vehicles registered in foreign states. The State moved for reconsideration. Upon reconsideration, the court confirmed the dismissal, and the State appeals. We affirm.
The record shows that defendant was arrested while driving a 1979 Buick within the City of Rock Island. The vehicle had an Iowa registration number and "applied for" license tag, and defendant's driver's license showed a Davenport, Iowa, home address. Based on this information on the face of the traffic citation, the trial court dismissed the insurance violation charge sua sponte. In its formal written order, the court also noted that if the mandatory liability insurance statute applied to nonresident motorists, it would violate the commerce clause of the United States Constitution (U.S. Const., art. I, § 8).
Subsequently, at the hearing on the State's motion for reconsideration, the arresting officer testified that he asked defendant if the vehicle was insured, and defendant said that it was not. The officer then cited defendant for a violation of section 3-707 of the Illinois Vehicle Code (625 ILCS 5/3-707 (West 1998)). After taking the cause under advisement, the court concluded that the legislature did not intend for the mandatory liability insurance statute to apply to vehicles registered in other states. Accordingly, the court ruled that its original order dismissing the charge was proper.
On appeal, the State argues that (1) the trial court lacked authority to dismiss the complaint on its own motion; (2) the court's interpretation of the statute was erroneous; and (3) applying the statute to nonresident drivers does not violate the commerce clause. Defendant has not filed a brief; therefore, we consider the case on the State's brief and our independent research. See First Capitol Mortgage Corp. v. Talandis Construction Corp., 63 Ill.2d 128, 345 N.E.2d 493 (1976).
Initially, we reject the State's contention that the trial court lacked authority to dismiss the charge on its own motion. Upon motion of the defendant, a trial court may dismiss a charging instrument that fails to state an offense. 725 ILCS 5/114-1(a)(8) (West 1998). A judge's sua sponte dismissal of a complaint may be error where no notice or opportunity to respond to the court's motion is given. See, e.g., People v. Kitchen, 189 Ill.2d 424, 244 Ill.Dec. 890, 727 N.E.2d 189 (1999). However, where, as here, the State was given ample opportunity to develop a response to the court's motion and present its position at a hearing, the State cannot claim prejudice. Therefore, a reversal based on the pro se defendant's failure to file the motion on his own behalf is unwarranted. See Perry v. Minor, 319 Ill.App.3d 703, 253 Ill.Dec. 339, 745 N.E.2d 113 (2001).
Next, we consider the State's argument that the trial court erred in ruling that the mandatory liability insurance law does not apply to nonresident drivers. This is apparently an issue of first impression in Illinois.
Section 3-707 of the Illinois Vehicle Code provides, in relevant part, as follows:
"No person shall operate a motor vehicle unless the motor vehicle is covered by a liability insurance policy in accordance with Section 7-601 of this Code.

*1260 * * *
Any operator of a motor vehicle subject to registration under this Code who is convicted of violating this Section is guilty of a business offense and shall be required to pay a fine in excess of $500, but not more than $1,000." (Emphasis added.) 625 ILCS 5/3-707 (West 1998).
The statute appears ambiguous in that it initially proscribes the operation of any motor vehicle without liability insurance, but it penalizes only those who operate such a vehicle if the vehicle is required to be registered in Illinois.
Vehicles subject to registration and those exempt from registration in Illinois are addressed in section 3-402. That section provides in relevant part:
"Any motor vehicle * * * operated interstate need not be registered in this State, provided:
(a) same is properly registered in another State pursuant to law * * *." 625 ILCS 5/3-402(B)(2)(a) (West 1998).
In construing statutes, we are guided by well-established principles. A primary rule of statutory construction is to give effect to the legislative intent. People v. Whitney, 188 Ill.2d 91, 241 Ill.Dec. 770, 720 N.E.2d 225 (1999). Where the statutory language is clear and unambiguous, its plain meaning should be given effect. Whitney, 188 Ill.2d 91, 241 Ill.Dec. 770, 720 N.E.2d 225. However, if the language of a statute is ambiguous, the court may consider extrinsic aids, including legislative history, to determine the legislature's intent. Whitney, 188 Ill.2d 91, 241 Ill.Dec. 770, 720 N.E.2d 225. Further, statutes which relate to the same subject are deemed to be in pari materia and should be construed together. People ex rel. Daley v. Datacom Systems Corp., 146 Ill.2d 1, 165 Ill.Dec. 655, 585 N.E.2d 51 (1991). A court should avoid an interpretation that would render any portion of a statute meaningless or void. McNamee v. Federated Equipment & Supply Co., 181 Ill.2d 415, 229 Ill.Dec. 946, 692 N.E.2d 1157 (1998).
Applying the foregoing principles, it is clear that the trial court properly concluded that the mandatory liability insurance statute does not apply to defendant's vehicle. Accepting the State's position that section 3-707 applies to vehicles registered in other states would render meaningless the language "subject to registration under this Code," because the registration section (625 ILCS 5/3-402 (West 1998)) expressly exempts vehicles registered in other states. The traffic citation in this case indicated on its face that defendant's vehicle was registered in Iowa. The vehicle was not subject to registration under the Illinois Vehicle Code; therefore, defendant was not subject to a penalty under section 3-707.
Further support for this conclusion may be found in the legislative history of section 3-707. Prior to the enactment of Public Act 86-1179 (Pub. Act 86-1179, eff. August 17, 1990), section 3-707 provided in relevant part as follows:
"No person shall operate a motor vehicle unless the motor vehicle is covered by a liability insurance policy in accordance with Section 7-601 of this Code. This provision applies to operators and motor vehicles regardless of the state or jurisdiction in which they respectively are licensed or registered.

* * *
Any person convicted of violating this Section is guilty of a business offense and shall be required to pay a fine in excess of $500, but not more than $1,000." (Emphasis added.) Ill.Rev.Stat.1989, ch. 95½, par. 3-707.
Public Act 86-1179 amended the statute by deleting the above highlighted language *1261 and by adding the qualifying language in the penalty clause restricting the statute to vehicles registered under the Code. See 625 ILCS 5/3-707 (1998). The only logical explanation for the amendment is that the legislature intended to confine the reach of the statute to vehicles registered in Illinois. Accordingly, we hold that the trial court properly dismissed the complaint in this case.
Finally, the State argues that the trial court erred in ruling that the statute would violate the commerce clause if it applied to nonresident motorists. Having determined that the statute does not apply to motorists operating vehicles registered in other states, we do not reach the constitutional question. See Wolens v. American Airlines, Inc., 147 Ill.2d 367, 168 Ill.Dec. 133, 589 N.E.2d 533 (1992).
For the reasons stated, we affirm the judgment of the circuit court of Rock Island County.
Affirmed.
HOLDRIDGE and SLATER, J J., concurred.
