Respondent Shawn Hockenbury was adjudicated to be a miscreant child. He appeals from an order of the district court denying his motion to dismiss the petition alleging miscreancy for lack of jurisdiction.
Hockenbury, who was sixteen years old at the time, was arrested on October 3, 1982, for driving under the influence of intoxicating liquor (DUI). K.S.A. 8-1567. Under the law in existence at the time of the alleged offense, he was within the exclusive jurisdiction of the juvenile code. K.S.A. 38-815(b) and K.S.A. 38-802(e). However, when the Kansas Juvenile Offenders Code became effective January 1, 1983, all traffic offenses committed by persons fourteen or more years of age became subject to prosecution as adult violations. K.S.A. 1983 Supp. 38-1602(h)(1). Thus, under the new code respondent would have to be treated as an adult and a juvenile petition alleging miscreancy would provide no jurisdiction over him for the alleged offense.
Although respondent’s adjudicatory hearing was originally scheduled for December 20,1982, it was continued on request of respondent’s counsel because of a scheduling conflict. Because *451the hearing was then set for January 3, 1983, two days after the new law became effective, respondent moved for dismissal contending that the court no longer had jurisdiction to treat him as a juvenile for this offense. The court denied the motion to dismiss and respondent was found to be miscreant. He appeals.
This case stands in rather an unusual posture. The juvenile is urging his treatment as an adult, presumably in order that he may be entitled to a jury trial, even though the potential consequences of conviction as an adult are more severe than those which attach to adjudication as a miscreant. Meanwhile, the State is arguing that respondent should only be amenable to the jurisdiction provided by the juvenile code. Resolution of this issue hinges on whether the new jurisdictional limits placed on juvenile adjudications are retroactive.
Ordinarily, a new statute will only operate prospectively unless its language clearly indicates the legislature intended it to operate retrospectively or the statutory change is merely procedural or remedial in nature and does not prejudicially affect substantive rights of the parties. Stair v. Gaylord, 232 Kan. 765, 771-72, 659 P.2d 178 (1983). A statutory change which alters the criminality of an offense is a substantive change. State v. Augustine, 197 Kan. 207, 416 P.2d 281 (1966). Therefore, since the newly enacted Kansas Juvenile Offenders Code narrows the jurisdictional limits placed on juvenile proceedings by rendering all traffic offenses committed by persons 14 or more years of age criminal acts, the new statute is a substantive rather than a procedural change in our law. However, respondent contends that despite the nature of the statutory change, retroactive application is dictated by the following provision in the new code:
“Unless the court finds that substantial injustice would result, the provisions of this code shall govern with respect to acts done prior to the effective date of this code and with respect to juveniles alleged or adjudicated to have done the acts, to the same extent as if the acts had been done on or after the effective date and the juveniles had been alleged or adjudicated to be juvenile offenders.” K.S.A. 1983 Supp. 38-1604(4).
The district court rejected respondent’s argument holding that retroactive application of the new law would require the State to dismiss the miscreancy petition and file criminal charges against respondent in order to address the alleged DUI offense. Since the significance of the new code only became an issue in this case because of a delay by respondent’s counsel, the court found *452that application of the new code would result in an injustice. Respondent contends that this holding is erroneous arguing that the exception to retroactivity for “substantial injustice” demands more than mere inconvenience to the State. We conclude that consideration of whether the court correctly interpreted the meaning of “substantial injustice” is unnecessary because K.S.A. 1983 Supp. 38-1604(d) was not intended to apply to substantive changes in the law such as the one involved in this case.
Under the prior law, certain traffic offenses when committed by a child under the age of fourteen could only be addressed in juvenile proceedings. K.S.A. 38-802(e). These violations included driving with a suspended or revoked license (K.S.A. 8-262), driving after adjudication as a habitual violator (K.S.A. 8-287), reckless driving (K.S.A. 8-1566), fleeing or attempting to elude a police officer (K.S.A. 8-1568), vehicular homicide (K.S.A. 21-3405) and DUI (K.S.A. 8-1567). The new juvenile offender code eliminates the special treatment previously shown these offenses and requires that all traffic offenders fourteen or more years of age be criminally prosecuted. Respondent asks this Court to construe K.S.A. 1983 Supp. 38-1604(c?) as generally mandating retroactivity for all of the statutory changes effected by enactment of the new code, with a narrow exception for cases of substantial injustice. This we cannot do.
It is the duty of the appellate courts to construe statutes in such a way as to make them constitutionally valid if there is any reasonable way to do so. Capital Electric Line Builders, Inc. v. Lennen, 232 Kan. 379, 384, 654 P.2d 464 (1982). If K.S.A. 1983 Supp. 38-1604(d) were held to subject respondent to criminal prosecution for an act which was not criminal when he allegedly committed it, then the provision would be an ex post facto law violative of the U.S. Constitution. U.S. Const, art. 1, § 10; Artez v. Mulcrone, 673 F.2d 1169 (10th Cir. 1982). In enacting K.S.A. 1983 Supp. 38-1604(d), the legislature must have intended for the courts to retroactively apply the procedural aspects of the new code while retaining discretion to refuse to do so if substantial injustice would result. Substantive changes, such as the one involved here, are controlled by the general rule which leaves unaffected a proceeding commenced under or by virtue of a statute subsequently repealed. K.S.A. 77-201 First. K.S.A. 1983 Supp. 38-1604(<¿) has no bearing on substantive changes in the *453juvenile code rendering acts criminal which previously were not.
The judgment of the district court, if correct, is to be upheld, even though the court may have relied upon a wrong ground or assigned an erroneous reason for its decision. Smith v. Stewart, 233 Kan. 904, 907, 667 P.2d 358 (1983). The statutory changes represented in K.S.A. 1983 Supp. 38-1602(h)(l) were correctly held not to retroactively apply to respondent.
Affirmed.