
440 Mich. 631 (1992)
489 N.W.2d 60
PEOPLE
v.
MILLER
Docket No. 90547, (Calendar No. 3).
Supreme Court of Michigan.
Argued January 7, 1992.
Decided September 15, 1992.
Frank J. Kelley, Attorney General, Gay Secor Hardy, Solicitor General, James J. Gregart, Prosecuting Attorney, and Michael H. Dzialowski, Assistant Prosecuting Attorney, for the people.
Patricia S. Slomski for the defendant.
BOYLE, J.
The issue presented is whether MCL 330.2044(1)(b); MSA 14.800(1044)(1)(b), requiring dismissal of pending criminal charges against an incompetent defendant after fifteen months, is calculated on a continuous or total time basis and whether reversal is required when an otherwise error free conviction is entered after expiration of the statutory commitment period. We find that a defendant may not be committed, by reason of incompetence to stand trial on criminal charges, for periods totaling fifteen months. However, a trial court's failure to dismiss the charges against a defendant does not deprive the trial court of jurisdiction, nor does a violation of § 1044(1)(b), standing alone, furnish a basis on which to reverse an otherwise valid conviction. Absent a claim of prejudice to the defendant's substantive rights, failure to dismiss is a procedural violation on which reversal may not be predicated. We affirm *634 the decision of the Court of Appeals in part and reverse its decision in part.
I
The facts in this case are undisputed and are set forth in the Court of Appeals opinion, 186 Mich App 238, 239-240; 463 NW2d 250 (1990):
After a jury trial, defendant was found guilty but mentally ill on a charge of first-degree criminal sexual conduct, sexual penetration by use of force or coercion and infliction of personal injury on the victim, MCL 750.520b(1)(f); MSA 28.788(2)(1)(f). The trial court sentenced defendant to a prison term of ten to thirty years, with credit for 1,160 days served.... On April 17, 1985, defendant was arrested and charged with first-degree criminal sexual conduct. On April 24, 1985, defendant's preliminary examination was adjourned when the district court ordered a competency evaluation. After a hearing on June 26, 1985, the district court adjudicated defendant incompetent to stand trial. On February 18, 1986, the court found that defendant remained incompetent. However, four months later, on June 18, 1986, defendant was found competent to stand trial and was ordered to undergo evaluation for criminal responsibility. Defendant remained at the forensic center until August 6, 1986, when he waived preliminary examination and was bound over for trial in circuit court. Defendant was arraigned in circuit court on August 18, 1986.
On August 27, 1986, the circuit court ordered a second competency evaluation of defendant. On December 16, 1986, defendant was again found incompetent to stand trial and was committed for treatment. Orders of continued incompetency and commitment were entered on April 10, June 23, and November 3, 1987. On February 16, 1988, counsel stipulated to defendant's competency pursuant to an expert's recommendation, and the *635 court adjudicated defendant competent to stand trial.
Beginning on April 7, 1987, defendant moved several times to dismiss the charges pursuant to MCL 330.2044(1); MSA 14.800(1044)(1) because he had been adjudicated incompetent for a total period of more than fifteen months, excluding the period from June to December 1986, during which he was competent.
The trial court denied the defendant's motions to dismiss because, although the defendant had been adjudicated incompetent a total period of twenty-six months, he had not been incompetent for a period of fifteen continuous months. The Court of Appeals reversed the decision of the trial court, holding that § 1044(1)(b) required the dismissal of pending criminal charges against a defendant after a total of fifteen months of incompetency. Because the defendant was incompetent at the time he moved for dismissal, the court ordered that the charges be dismissed. Leave to appeal was granted, 437 Mich 1036 (1991).
II
MCL 330.2044; MSA 14.800(1044) provides:
(1) The charges against a defendant determined incompetent to stand trial shall be dismissed:
(a) When the prosecutor notifies the court of his intention not to prosecute the case; or
(b) Fifteen months after the date on which the defendant was originally determined incompetent to stand trial.
(2) When charges are dismissed pursuant to sub-section (1), the same charges, or other charges arising from the transaction which gave rise to the dismissed charges, shall not subsequently be filed against the defendant, except as provided in this section.

*636 (3) If the charges were dismissed pursuant to subsection (1)(b) and if the crime charged was punishable by a sentence of life imprisonment, the prosecutor may at any time petition the court for permission to again file charges. In the case of other charges dismissed pursuant to (1)(b), the prosecutor may, within that period of time after the charges were dismissed equal to 1/3 of the maximum sentence that the defendant could receive on the charges, petition the court for permission to again file charges.
(4) The court shall grant permission to again file charges if after a hearing it determines that the defendant is competent to stand trial. Prior to the hearing, the court may order the defendant to be examined by personnel of the center for forensic psychiatry or other qualified person as an outpatient, but may not commit the defendant to the center or any other facility for the examination.
Section 1044(1)(b) is the procedural vehicle for enforcing a defendant's right not to be confined solely because of incompetency. In addition, because dismissal of the charge starts the statute of limitations running in respect to those crimes that do not carry a possibility of life in prison, § 1044(1)(b) also supports the repose interest of defendants charged with crimes carrying less than life penalties. However, §§ 1044(3), (4) limit the government's ability to charge. A violation of § 1044(1)(b) predicated solely on the erroneous denial of a motion to dismiss constitutes a ground for reversal only where it is claimed that the failure to dismiss denied defendant a substantive right, to wit: the barring of the charge or prejudice caused by the delay resulting from a violation of § 1044(1)(b).[1] Failure to dismiss after expiration of a total period of fifteen months is not error on which reversal can be predicated.
*637 The concurrence's explicit conclusion that there was error in failing to dismiss accepts the Court of Appeals implicit conclusion that § 1044(1)(b) is an expression of the Legislature's intention to deprive the trial court of jurisdiction to try a competent defendant after the lapse of fifteen months of confinement for treatment. The majority in the Court of Appeals reached the conclusion that, although the defendant was competent when tried and the Legislature specifically authorized proceedings against him at any time during his life, it nonetheless intended that the conviction be reversed because charges were not dismissed and refiled. As Justice RILEY remarked in another context, "[i]t is difficult to conclude that the Legislature intended that validly convicted defendants should go free under these circumstances," People v Crawford, 429 Mich 151, 167; 414 NW2d 360 (1987).
Although hardly a model of clarity, the structure of the act and the legislative history suggest that §§ 1044(3), (4) are limitation provisions and that reversal of a conviction would be warranted in respect to nonlife offenses only where the time lapse from initial adjudication of incompetence exceeds one third of the maximum sentence or causes prejudice to the defendant's substantive rights.
III
The question presented involves the not unfamiliar issue whether the Legislature intended that violation of a statutory directive should result in a limitation on the judicial authority. The dissent assumes that the Legislature has mandated that reversal is required where successive periods of confinement for treatment exceed fifteen months. *638 Our disagreement with that conclusion rests on the fact that the Legislature has not so limited the jurisdiction of the trial court. Rather, it has expressly said that charges may be refiled with certain limitations applied to less than life offense charges.
The Legislature has not purported to confer the right on a defendant charged with a life offense to challenge the jurisdictional basis for conviction. Thus, because the only limitation on the refiling of charges is that charges for other than life offenses shall be filed "within that period of time after the charges were dismissed equal to 1/3 of the maximum sentence," it appears that the Legislature did not contemplate that the failure to dismiss charges was to be enforced by reversal, despite the absence of prejudice. Section 1044(3). The structure of the act, its purposes, the specific provisions of the section at issue, and the legislative history support this conclusion.
The court's initial focus under the act is on whether, if provided a course of treatment, a substantial probability exists that a defendant found to be incompetent will attain competence within the time limit established, i.e., fifteen months or one third of the sentence, "whichever is lesser." MCL 330.2034(1); MSA 14.800(1034)(1). If the court cannot make that determination, the defendant may be subjected to civil process, but may not be committed for treatment. Likewise, the focus of § 1040, redetermination of incompetency, and § 1038 is judicial evaluation through ninety-day reports and hearings (unless waived) on progress throughout the fifteen-month period toward obtaining competence to stand trial. If at any point the court cannot make the determination that the defendant is likely to become competent within fifteen months, it may not continue to confine the defendant for treatment.
*639 Section 1034 appears to implement § 1036[2] and provides that "[n]o order or combination of orders issued under section 1032 or 1040, or both, shall have force and effect for a total period in excess of 15 months or 1/3 of the maximum sentence ... whichever is lesser ...." (Emphasis added.) Section 1034 thus limits orders of treatment to a total period not to exceed fifteen months and prohibits orders for treatment "after the charges against the defendant are dismissed." These provisions guard against misuse of incompetency "to dispose of mentally-ill defendants without a real trial on the merits of substantive insanity," George, Michigan's new mental health legislation for criminal cases, 46 Mich St B J 13, 17 (February, 1967), and implement the constitutional right to a judicial determination of an individual's right not to be detained without benefit of the process available to those subject to civil commitment, Baxstrom v Herold, 383 US 107; 86 S Ct 760; 15 L Ed 2d 620 (1965). Taken together, these sections direct the mental health department not to confine a defendant for treatment solely because of incompetency for a period exceeding fifteen months.
IV
The section at issue here, § 1044(1)(b), provides that charges shall be dismissed "[w]hen the prosecutor notifies the court of his intention not to prosecute the case," or "[f]ifteen months after the date on which the defendant was originally determined incompetent to stand trial." However, charges are not barred, and permission to refile *640 "shall" be granted if the defendant is determined competent and permission to refile is sought within a period after charges were dismissed equal to one third the possible maximum. In this interval, the prosecution may seek civil commitment, opt to dismiss, or challenge the competency evaluation of the department with a view to trying the charges.[3] When read in its entirety, § 1044 protects the defendant's interest in indefinite suspension of trial, People v Bowman, 141 Mich App 390, 400; 367 NW2d 867 (1985), and his liberty interest in freedom from commitment. The provision permitting refiling of charges protects the interest of the public in enforcing the criminal law if the defendant is competent, or in securing civil commitment where the prosecution can show mental illness and that the individual can be reasonably expected to be dangerous to himself or others within the near future. MCL 330.1401; MSA 14.800(401), MCL 330.1515; MSA 14.800(515).
Support for this construction appears in the legislative history. The predecessor statute, 1966 PA 266, limited commitment for incompetency alone to an eighteen-month period, following which the Department of Mental Health was to certify its belief of continued incompetency to the probate court. If the probate court determined that the defendant was not to be committed, jurisdiction was transferred to the original trial court for a hearing "de novo" on the question of competency, MCL 767.27a(8); MSA 28.966(11)(8). To protect the defendant's interest in avoiding the indefinite suspension of trial, the statute provided that "[t]he statute of limitations on the pending criminal charge... shall commence to run on the entry of an order of commitment ... and shall *641 continue to run until and unless the committing court determines... that the defendant is competent to stand trial." MCL 767.27a(9); MSA 28.996(11)(9). Thus, as noted by Professor George, on a transfer of defendant to probate court, the statute of limitations continued to run. 46 Mich St B J, supra, p 20.
Stating that the existing statute created the possibility of a defendant being left in limbo between the jurisdiction of the criminal court and that of the probate court, and that the situation had been exacerbated by an informal opinion of the Attorney General that an order of recommitment caused the eighteen-month commitment period to begin anew, the working papers for the revision that produced the current statute called for elimination of indefinite commitment and dismissal of criminal charges when a defendant was hospitalized for a period longer than the maximum probable sentence that would be imposed against him. Michigan Legislative Committee to Revise the Mental Health Statutes, Criminal Commitment and Maximum Security Confinement  Working Paper, October 14, 1970, pp 69-72.[4] One draft of the statute called for a nine-month refiling and a fifteen-month dismissal period, and another draft called for a one-year refiling and a one-year dismissal period. These drafts, like the final product, reflected the concept of a period after dismissal for refiling before charges are barred.[5]
It is reasonable to assume that the act which we construe is the compromise response. Formal transfer to probate court is eliminated and commitment *642 for competency is reduced to a total period of fifteen months. In place of the former statute of limitations, which explicitly provided that the statute was triggered by an order of commitment, the new statute provides a fifteen-month commitment period and a dismissal, thus effectively providing that the statute of limitations runs during periods of commitment for treatment. Because statutes of limitation are tolled if criminal charges are pending, dismissal at the expiration of fifteen months serves to keep the statute running during the period equal to one third the maximum, whether the prosecutor proceeds with civil commitment or not. Thus, the interests of defendants charged with less than life offenses are protected by providing that charges may not be refiled if the lapse of time exceeds one third the possible maximum. So construed, the dismissal provision functions as a device to secure a defendant's release both from confinement and the pendency of criminal charges (whether for life or a lesser offense). With regard to less than life offenses, dismissal of the charges begins the statute of limitations running again, thus serving the function of the statute of limitations provision expressly set forth in the predecessor statute.
The construction that best appears to accomplish the statutory goals is that commitment for treatment can be ordered for no more than a total of fifteen months in order to protect the liberty interest set forth in § 1036. After this period, competency must be established through civil process or otherwise. Because § 1044(1)(b) requires dismissal of pending criminal charges after a total of fifteen months, the failure to do so violates the statute. The appropriate remedy for such a violation is the filing of a writ or a motion testing the *643 authority of the court to continue confinement and an appeal from denial. The Legislature has not suggested, however, that if release is denied and charges are not dismissed, a subsequent conviction is subject to reversal. Absent a claim of prejudice to the defendant's substantive rights, failure to dismiss is a procedural violation for which reversal may not be claimed. Finally, under § 1044(3), the state has a period equal to one-third the maximum in which to petition to refile charges or otherwise vindicate the public interest by seeking civil commitment.
CONCLUSION
The construction that advances the legislative purpose to protect the defendant's rights and the public interest is that, for purposes of § 1034, periods of treatment must be tacked to protect a defendant's liberty interest. Dismissal is governed by § 1044(1)(b). Reversal, however, absent claims of prejudice from delay, is governed by §§ 1044(3), (4), not § 1044(1)(b). Neither mandates reversal or dismissal of the instant charges.
The legislative intention is clear. A conviction shall not be set aside for error regarding any matter of procedure unless it shall affirmatively appear that the error complained of has resulted in a miscarriage of justice. MCL 769.26; MSA 28.1096. For the reasons stated above, the decision of the Court of Appeals is reversed in part, affirmed in part, and the conviction and sentence of the defendant are reinstated.
BRICKLEY, RILEY, and GRIFFIN, JJ., concurred with BOYLE, J.
LEVIN, J. (concurring).
We agree, for the reasons *644 set forth in Judge MAHER'S opinion,[1] that the provision of the Mental Health Code,[2] requiring that charges against a defendant determined incompetent to stand trial be dismissed fifteen months after the date on which the defendant was originally determined incompetent to stand trial, does not require an uninterrupted period of incompetence and may, as in this case, be comprised of a number of periods of incompetence, totaling fifteen months in duration and occurring after the original determination of incompetence.
The Mental Health Code further provides that if charges are so dismissed "and if the crime charged was punishable by a sentence of life imprisonment, the prosecutor may at any time petition the court for permission to again file charges."[3]
The defendant, Willie Albert Miller, was charged with first-degree criminal sexual conduct.[4] In the interval between arrest and trial Miller was adjudicated incompetent to stand trial for nearly twelve months, June, 1985, through June, 1986, and for an additional fourteen months, December, *645 1986, through February, 1988, for a total of nearly twenty-six months.
In early 1988, Miller moved to dismiss on the basis of the statute. The judge denied the motion, and Miller was found competent to stand trial and was found by a jury to be guilty but mentally ill of first-degree criminal sexual conduct. He was sentenced to served ten to thirty years in prison with credit for 1,160 days served.
Under the circumstance that an earlier opinion of the Court of Appeals[5] construed the statute as requiring fifteen consecutive months, and because Miller could again be charged and retried for first-degree criminal sexual conduct, a life-sentence offense, failure of the judge to grant Miller's motion to dismiss was harmless.
CAVANAGH, C.J., and MALLETT, J., concurred with LEVIN, J.
NOTES
[1]  There is no claim that the failure to dismiss jeopardized defendant's right to a fair trial.
[2]  Section 1036 provides in pertinent part that the right to bail shall not be impaired "because the defendant has been ordered to undergo treatment to render him competent to stand trial, except to the extent authorized by ... section 1032 for the purpose of administering a course of treatment."
[3]  However, a defendant may not be committed to the center or other facility for a competency examination. Section 1044(4).
[4]  See also Report of Mental Health Programs and Statutes Review Committee, March 15, 1972, pp 28-30.
[5]  HB 5684, 1974 Journal of the House 270; Michigan Legislative Committee to Revise the Mental Health Statutes, Mentally Disabled Individuals Charged with Crimes  Discussion Draft, July 19, 1972, pp 10-11.
[1]  186 Mich App 238; 463 NW2d 250 (1990).
[2]  charges against a defendant determined incompetent to stand trial shall be dismissed:
* * *
Fifteen months after the date on which the defendant was originally determined incompetent to stand trial. [MCL 330.2044(1)(b); MSA 14.800(1044)(1)(b).]
[3]  MCL 330.2044(3); MSA 14.800(1044)(3).

Subsection 1044(3) further provides:
In the case of other charges dismissed pursuant to subsection (1)(b), the prosecutor may, within that period of time after the charges were dismissed equal to 1/3 of the maximum sentence that the defendant could receive on the charges, petition the court for permission to again file charges.
[4]  MCL 750.520b(1)(f); MSA 28.788(2)(1)(f).
[5]  People v John, 129 Mich App 664; 341 NW2d 861 (1983).
