
78 Ill. App.2d 350 (1966)
223 N.E.2d 428
People of the State of Illinois, Appellee,
v.
Wayne Wesley, Appellant.
Gen. No. 50,767.
Illinois Appellate Court  First District, Third Division.
December 22, 1966.
*351 Gerald W. Getty, Public Defender of Cook County, of Chicago (Marshall J. Hartman and James J. Doherty, Assistant Public Defenders, of counsel), for appellant.
Daniel P. Ward, State's Attorney of Cook County, of Chicago (Elmer C. Kissane and Joel M. Flaum, Assistant State's Attorneys, of counsel), for appellee.
MR. JUSTICE SCHWARTZ delivered the opinion of the court.
This is an appeal from judgments resentencing the defendant to the penitentiary pursuant to an order of the Supreme Court in a prior appeal. People v. Wesley, 30 Ill.2d 131, 195 NE2d 708 (1964). In 1961 the defendant, who was 16 years old at the time of the trial, was found guilty on five separate indictments and sentenced as follows:


   Indictment No. 61-353  Rape ..... Life Imprisonment.
        "      "  61-354  Armed Robbery ...... 10 Years
                  to Life.
        "      "  61-355  Assault with Intent to Murder
                  ....................... 5 to 10 years.
        "      "  61-356  Rape .............. 35 years.
        "      "  61-357  Armed Robbery ....... 5 to 20
                  years, (to run consecutively to the first
                  four sentences).

*352 The statute in effect at that time required that defendants under the age of 17 be committed to the Illinois Youth Commission for the offenses of armed robbery and assault, but it permitted sentencing to the penitentiary for the crime of rape.[1] The sentences imposed by the trial court in Indictments No. 61-354, 61-355 and 61-357 were therefore erroneous. On appeal to the Supreme Court the State confessed error and the court reversed all five judgments and remanded the cause to the trial court for "proper sentencing." People v. Wesley, supra. In 1964, when the defendant was 19 years old, the trial court resentenced him to the penitentiary on the charges of rape, as in 1961, and committed him to the Youth Commission on the other charges. In 1963, however, the law had been amended to provide that offenders *353 under the age of 17 for boys and 18 for girls should be committed to the Youth Commission regardless of the nature of the crime.[2] Defendant now contends that the trial court should have resentenced him to the Youth Commission on all five charges. He further contends that as the limit of age for sentencing to the Youth Commission is now 21 (Ill Rev Stat, ch 23, Sec 2523 (1965)) and as the defendant is now over 21, the court has no power to do anything but discharge him.
[1] The first question is whether the court acted properly in applying the law as it existed at the time of the original trial or whether it was bound by the statute as amended. In People v. Hansen, 28 Ill.2d 322, 192 NE2d 359, the court dealt with this problem, but the facts differed in that the judgment had been entered before the new law took effect. The court stated, at 341:
"Judgment and sentence here were pronounced prior to the effective date of the new Code, which incorporates by reference section 4 of the Statutory Construction Act, (Ill Rev Stat, 1961, chap 38, 34-3,) which provides that a punishment mitigated by a new law is applicable only to judgments after the new law takes effect. Ill Rev Stats, 1961, chap 131, par 4."
The judgments in the instant case having been rendered after the amended statute had become effective, the trial court should have applied the new law and sentenced the defendant to the Youth Commission for all of his offenses.
[2] The State points out that defendant was 19 years old at the time of resentencing and therefore was too old to be sent to the Youth Commission. In People v. Carr, *354 23 Ill.2d 103, 177 NE2d 361, the trial court sentenced to the penitentiary an offender who was 17 years old at the time of the trial, but only 16 years old when the crime was committed. The Illinois Supreme Court reversed the sentence and remanded the case with directions to commit the defendant to the Youth Commission, despite the fact that at the date of filing of the opinion the defendant was almost 19 years old. The court said, at 105:
"The purpose of the Youth Commission is to reform the young offender, and that may still be accomplished although the defendant is a year older on the date that he comes under its care."
It would therefore have been proper for the trial court in the case before us to resentence the defendant to the Youth Commission, although had he been 19 at the time of the trial, he would have been too old to receive such sentence.
[3] We are faced with the argument, however, that defendant is now over 21 years of age, too old to be sent to the Youth Commission even on remand. Defendant's position, to summarize it here, is that he should have been sent to the Youth Commission at the time of resentencing, but that the time is now past when he may be so committed and therefore this court has no alternative but to release him outright. In People v. Carr, supra, the court said, at 105:
"We think that it is manifest that the legislature did not intend `that sentencing should be a game in which a wrong move by the judge means immunity for the prisoner.' (Bozza v. United States, 330 U.S. 160, 166, 91 L Ed 818.) The question is whether the objectives of the Sentence and Parole Act require that this type of error should be held to free the defendant entirely from the corrective processes of the State. In different circumstances we have held *355 that an error in sentencing can be corrected by imposing the sentence that should have been imposed,... and we think that should be done here."
The proper solution in the case before us is to commit the defendant to the Illinois Youth Commission. The statute with respect to such matters provides that upon termination of control by the Commission, the defendant will immediately become subject to the Department of Public Safety, which will review his status and that the Commission shall "hold such person subject to the order of such department...." (Ill Rev Stats, c 23, § 2523 (1965).)
The judgments in Indictments Nos. 61-353  Rape, and 61-356  Rape, are reversed and the cause is remanded with directions to commit the defendant to the Illinois Youth Commission.
Judgments in Indictments Nos. 61-353 and 61-356 reversed and causes remanded with directions.
SULLIVAN, P.J. and DEMPSEY, J., concur.
NOTES
[1]  Ill Rev Stats, ch 38, § 801 (1959).

"801. Sentence for Misprision of Treason, Murder, Voluntary Manslaughter, Rape or Kidnapping,  Parole.)
"§ 1. In all cases where any person, male or female, over ten years of age, shall be charged with ... rape ... and ... the case is tried by the court, without a jury ... and the court shall impose imprisonment as a punishment, the court shall fix a definite term of imprisonment, and the court in each case, shall fix the place of confinement.... In every such case of imprisonment, the court shall sentence the defendant to the penitentiary, unless the defendant is a female....
"803. Commitment  Penitentiary  Illinois State Reformatory or State Training School for Boys  Transfer  Youth Commission  State Reformatory for Women.)
"§ 3. Except for the crimes enumerated in Section 1 of this Act [Section 801 of this chapter], every person, male or female, over ten years of age, who shall be adjudged guilty of felony, or other crime punishable by imprisonment in the penitentiary, ... shall in all cases, except as herein otherwise provided in clauses one and two, be sentenced to the penitentiary, and the court imposing sentence shall fix the minimum and maximum limits of duration of imprisonment.... Provided,
"Clause 1 ... Every male person under the age of 17 years adjudged guilty after December 31, 1953, of any offense enumerated in this Section shall be committed to the Youth Commission instead of the penitentiary."
[2]  Code of Criminal Procedure, 1963, effective January 1, 1964. Ill Rev Stats, ch 38, § 119-2

"(c) All male persons under 17 and females under 18 years of age sentenced to imprisonment shall be committed to the Illinois Youth Commission."
