delivered the opinion of the court:
The respondent, William Clarke, appeals from the trial court’s order continuing his hospitalization with the Department of Mental Health and Development Disabilities (the Department). The respondent argues that the trial court erred by denying his procedural rights under the Mental Health and Developmental Disabilities Code (Mental Health Code) (Ill. Rev. Stat. 1987, ch. 91½, par. 1 — 100 et seq.) and that the State did not prove by clear and convincing evidence that he was reasonably expected to inflict serious physical harm on another or himself in the near future. We reverse and remand.
On May 30, 1989, a Lake County trial court found the respondent unfit to stand trial on criminal charges; it also found that he was not expected to become fit within one year. The trial court remanded the respondent to the Department for further proceedings pursuant to section 104 — 23(b)(3) of the Code of Criminal Procedure of 1963 (Ill. Rev. Stat. 1987, ch. 38, par. 104 — 23(b)(3)). It further ordered that “an agent” of the Department interview the respondent and make fitness recommendations. Pursuant to the trial court’s order, Dr. Syed Anwar, a psychiatrist at the Elgin Mental Health Center (the Center), evaluated the respondent.
On June 14, 1989, the respondent’s social worker filed with the Kane County circuit clerk a petition for the respondent’s involuntary admission. On the same day, one of the Center’s employees filed a notice of a June 16, 1989, hearing on the petition, which later was continued to June 30. On June 30, 1989, the trial court appointed the Kane County public defender as the respondent’s counsel “nunc pro tunc to date of filing of petition.”
At trial, the respondent moved to dismiss the petition, arguing that it was untimely since he was remanded to the Center two weeks before the petition was filed, notwithstanding the requirement of section 3 — 607 of the Mental Health Code that the petition be filed within 24 hours of the admission (Ill. Rev. Stat. 1987, ch. 91V2, par. 3 — 607). The trial court, in denying the motion, relied upon section 104 — 23(b)(3) of the Code of Criminal Procedure of 1963 (Ill. Rev. Stat. 1987, ch. 38, par. 104 — 23(b)(3)) and found that the Lake County trial court retained jurisdiction over the matter until the parties complied with the May 30 order for Dr. Anwar to interview the respondent.
Following a bench trial, the trial court ordered that the respondent be involuntarily admitted to the Department. The respondent brought the instant appeal. Although he presents multiple arguments for reversal, we find dispositive his contention that counsel was not appointed for him until the day of the hearing, thus violating section 3 — 805 of the Mental Health Code. Ill. Rev. Stat. 1987, ch. 9IV2, par. 3-805.
Strict adherence to the procedural requirements of the Mental Health Code is necessary to protect the liberty interests of persons subjected to the involuntary admission process. (In re Splett (1990), 194 Ill. App. 3d 391, 393.) Section 3 — 805 of the Mental Health Code provides:
“Every respondent alleged to be subject to involuntary admission shall be represented by counsel. If the respondent is indigent or an appearance has not been entered on his behalf at the time the matter is set for hearing, the court shall appoint counsel for him. A hearing shall not proceed when a respondent is not represented by counsel ***. Counsel shall be allowed time for adequate preparation.” Ill. Rev. Stat. 1987, ch. 91½, par. 3 — 805.
If an attorney is to be appointed, the trial court must make the appointment at the time the hearing is set, and not merely at the hearing itself. (In re Walters (1989), 183 Ill. App. 3d 452, 455.) The trial court erred in waiting to appoint counsel for respondent (see In re Johnson (1989), 191 Ill. App. 3d 93, 95), and labeling the order nunc pro tunc cannot remedy the error. See In re Marriage of Erickson (1985), 136 Ill. App. 3d 907, 915.
Although we reverse and remand on other grounds, because we anticipate that one issue raised will present a problem on remand, we address it. The respondent argues that the trial court erred in denying his motion to dismiss the petition since the petition and certificates were not executed within 24 hours of his admission to the Center and, thus, were in violation of section 3 — 607 of the Mental Health Code (Ill. Rev. Stat. 1987, ch. 91V2, par. 3 — 607). The trial court found that the respondent was held pursuant to a court order stemming from the criminal charges in Lake County.
The State contends that the Code of Criminal Procedure, not the Mental Health Code, governs the proceedings before the hearing on the petition. We agree.
Section 104 — 23(b)(3) of the Code of Criminal Procedure of 1963 provides that if a trial court finds a criminal defendant unfit to stand trial, it shall remand the defendant to the Department’s custody and order a hearing to be conducted pursuant to the provisions of the Mental Health Code. The Code of Criminal Procedure expressly provides that “[i]f the defendant is committed *** pursuant to such hearing, the court having jurisdiction over the criminal matter shall dismiss the charges against the defendant, with the leave to reinstate.” Ill. Rev. Stat. 1987, ch. 38, par. 104 — 23(b)(3).
The fundamental objective in statutory construction is to ascertain the intention of the legislature and then to give effect to that intent. (People v. Rink (1983), 97 Ill. 2d 533, 539.) The intent of the legislature, as gleaned from the clear language of an Act, is the best source for determining legislative intent. See Schutzenhofer v. Granite City Steel Co. (1982), 93 Ill. 2d 208, 211-12.
After the trial court finds that a defendant is subject to involuntary admission, then the “former defendant so committed shall be treated in the same manner as any other civilly committed patient.” (Ill. Rev. Stat. 1987, ch. 38, par. 104 — 23(b)(3).) It is clear from the language of section 104 — 23(b)(3) that the trial court retains jurisdiction until the defendant is found to be subject to involuntary admission. Moreover, section 104 — 29 of the Code of Criminal Procedure provides, “In the event of any conflict between this Article and the ‘Mental Health and Developmental Disabilities Code’, the provisions of this Article shall govern.” (Ill. Rev. Stat. 1987, ch. 38, par. 104— 29.) We find that the trial court did not err in denying the respondent’s motion to dismiss the petition.
The respondent argues that our finding would permit a trial court to detain a defendant indefinitely without ever initiating a commitment hearing if it found the defendant to be unfit to stand trial. He relP'’ on the case of Jackson v. Indiana (1972), 406 U.S. 715, 32 L. Ed. 2d 435, 92 S. Ct. 1845. However, in Jackson, the Court held that a State must either institute a civil commitment proceeding or release the defendant. 406 U.S. at 738, 32 L. Ed. 2d at 451, 92 S. Ct. at 1858.
The respondent’s argument is misplaced. Section 104 — 23(b)(3) requires that the trial court remand a defendant to the Department’s custody “and order a [commitment] hearing.” (Emphasis added.) (Ill. Rev. Stat. 1987, ch. 38, par. 104 — 23(b)(3).) Since section 104 — 23(b)(3) provides for a commitment hearing, it satisfies the Jackson requirements; the respondent could not be indefinitely held without initiating a commitment hearing.
Based on the foregoing, we reverse the judgment of the circuit court of Kane County and remand the cause for rehearing.
Reversed and remanded.
UNVERZAGT, P.J., and INGLIS, J., concur.