
291 N.W.2d 25 (1980)
STATE of Iowa, Appellee,
v.
Lee Andrew SMITH, Appellant.
No. 63078.
Supreme Court of Iowa.
April 23, 1980.
*26 Michael E. Sheehy and William Wegman, Waterloo, for appellant.
Thomas J. Miller, Atty. Gen., and Douglas F. Staskal, Asst. Atty. Gen., for appellee.
Considered by HARRIS, P. J., and McCORMICK, ALLBEE, McGIVERIN, and LARSON, JJ.
McGIVERIN, Justice.
We granted further review of a court of appeals decision involving interpretation of the mandatory consecutive sentence provision in section 901.8, The Code 1979. We disagree with that court's interpretation; however, for a different reason we reach the same disposition as the court of appeals.
We believe the consecutive sentence requirement in the second sentence of section 901.8 constitutes an ex post facto law as to defendant Lee Andrew Smith under the facts in this case. Therefore, defendant's sentence is vacated and the case is remanded to the district court for resentencing.
Based on a felony conviction, defendant had been sentenced to the Iowa Men's Reformatory at Anamosa. He was later committed by prison authorities to the State Work Release Center at Waterloo. From there, defendant escaped on May 20, 1978. The trial information charged him with escape from custody in violation of section 719.4(1), The Code 1979,[1] and alleged he was an habitual criminal pursuant to section 902.8, The Code 1979.[2] Iowa R.Crim.P. 6(5). Smith was convicted by a jury and adjudged guilty of the crime of escape contrary to and in violation of section 719.4(1) on October 19, 1978. On December 28, 1978, the court, in a jury-waived trial, found defendant to be an habitual criminal pursuant to section 902.8. On January 26, 1979, defendant was sentenced under sections 902.8 (twice previously convicted of a felony) and 902.9(2) (an enhanced penalty for an habitual criminal) to confinement for a term of not to exceed fifteen years. Under section 902.8, defendant would not be eligible for parole until he has served the minimum sentence of three years.
The trial court concluded it was required by 1978 session, 67th G.A., chapter 1091, sections 4 (now section 901.8, The Code 1979) and 5 to order defendant's sentence to run consecutive to defendant's prior sentence, which was being served at the time of the escape. The court, therefore, ordered pursuant to the second sentence of section 901.8 that the period of confinement would begin at the expiration of any existing sentence that defendant was then serving.
Section 901.8 provides:

*27 If a person is sentenced for two or more separate offenses, the sentencing judge may order the second or further sentence to begin at the expiration of the first or succeeding sentence. If a person is sentenced for escape under section 719.4 or for a crime committed while confined in a detention facility or penal institution, the sentencing judge shall order the sentence to begin at the expiration of any existing sentence. If consecutive sentences are specified in the order of commitment, the several terms shall be construed as one continuous term of imprisonment.
(Emphasis added.)
Defendant appealed his conviction and sentence. We transferred the case to the court of appeals, which affirmed the conviction. However, that court (in a three-to-two decision) concluded that the trial court was not mandated under section 901.8 to impose a consecutive sentence and had the discretion to give a concurrent sentence.
We granted the State's application for further review of the issue of whether section 901.8 applied to defendant. A review of this issue requires an interpretation of the second sentence of section 901.8 in order to determine whether defendant's conduct falls within its mandates. Also, if the second sentence of section 901.8, by its express terms, applies to defendant, it will then be necessary to determine whether such a mandate constitutes an ex post facto law in violation of the United States Constitution, article I, section 9.
I. The court of appeals held that because defendant was given the enhanced penalty for habitual offenders (fifteen years) rather than the standard penalty for a class "D" felony escape under section 719.4(1) (five years), the mandate of consecutive sentencing in section 901.8 did not apply. That court reasoned that sentencing as an habitual offender does not involve sentencing "for escape under section 719.4 or for a crime committed while confined in a detention facility or penal institution," and therefore the second sentence of section 901.8 did not apply here. Because the trial court believed section 901.8 mandated a consecutive sentence, the court of appeals vacated defendant's sentence and remanded the case for resentencing.
The State contends on further review that the interpretation of the court of appeals of section 901.8 was in error. We agree with the State.
Defendant was convicted of escape under section 719.4(1). His sentence was enhanced under section 902.8. If defendant was not sentenced for escape under section 719.4(1), he could not have been sentenced for anything. Being an habitual offender under section 902.8 is not a criminal offense. Section 902.8 is a sentencing provision and no one could be convicted for violating that statute. State v. Popes, 290 N.W.2d 926 (Iowa 1980); State v. Hanna, 277 N.W.2d 605, 608 (Iowa 1979). Furthermore, if the phrase in section 901.8 "sentenced for escape under section 719.4" is read to mean "sentenced under the sentencing provisions of section 719.4," it becomes meaningless because section 719.4 contains no sentencing provisions. Rather, that statutory phrase must be read as merely defining the crime which triggers the application of section 901.8.
Under the court of appeals reading of section 901.8, whenever a defendant is charged with escape, either section 901.8 or section 902.8 (habitual offender) would be rendered inoperative. If the State sought enhanced punishment under section 902.8, it would necessarily mean a mandatory consecutive sentence under section 901.8 would not be possible. If the State desired a consecutive sentence, it would have to forego alleging habitual offender status. We do not believe this result was intended by the legislature when it drafted section 901.8. § 4.6(1) and (5), The Code 1979.
By habitual offender laws the State undertakes to more severely punish those incorrigible offenders who have not responded to the restraining influence of conviction and incarceration. State v. Robinson, 262 N.W.2d 270, 271 (Iowa 1978). We hold that section 901.8, when it does not have an ex post facto effect, does require a consecutive *28 sentence for an habitual offender who is sentenced for his conviction of escape under section 719.4 or for a crime committed while confined in a detention facility or penal institution.
We next consider the ex post facto question.
II. Defendant contends the trial court erroneously concluded that section 901.8 mandated a consecutive sentence for his May 20, 1978, offense because such an interpretation would cause section 901.8 to be an ex post facto law as applied to him. We agree.[3]
The Iowa Criminal Code, which became effective January 1, 1978, had no provision for consecutive sentences. State v. Buck, 275 N.W.2d 194, 196 (Iowa 1979). However, the legislature supplied such a provision by the adoption of section 901.8.
Section 901.8 was approved June 2, 1978. Section 5 of 1978 session, 67th G.A., chapter 1091 states that section 901.8 shall take effect and be in force retroactive to January 1, 1978, thereby applying to persons sentenced on or after January 1, 1978. In State v. Buck, 275 N.W.2d at 196 n.1, we did not consider, and reserved decision on, the issue of whether section 901.8 may be retroactively applied to those persons committing crimes on or after January 1, 1978, but before the enactment of section 901.8.
The first sentence of section 901.8 allows the sentencing judge discretion as to whether sentences shall be consecutive or concurrent as to separate offenses in general. This provision is declaratory of the common law and the court's inherent authority. State v. Buck, 275 N.W.2d at 196-97. However, the second sentence of section 901.8 does require that any sentence, imposed for escape under section 719.4 or for a crime committed while confined in a detention facility or penal institution, shall be a consecutive sentence.
Because defendant was sentenced on January 26, 1979, for an escape committed on May 20, 1978, section 901.8 would appear to apply to defendant by its express language and by the legislative mandate making section 901.8 retroactively applicable to persons sentenced on or after January 1, 1978. However, section 901.8 was not approved until June 2, 1978, and there was no sentencing provision dealing with concurrent or consecutive sentences for any crimes in the Code when defendant committed his crime on May 20, 1978. Therefore, the common law, as it was before statute, was revived leaving the trial court with discretion to impose a concurrent or consecutive sentence on defendant. State v. Buck, 275 N.W.2d at 196-97. Because application of the second sentence of section 901.8 to defendant would change the law in effect at the time of defendant's offense by making a consecutive sentence mandatory and remove the trial court's discretion in sentencing defendant either concurrently or consecutively, we believe section 901.8 does have an ex post facto effect when applied to defendant.
We have said:
The ex post facto clause of Article I, § 9, United States Constitution, forbids application of a new punitive measure to conduct already consummated where it operates to the detriment or material disadvantage of the accused. Accordingly, a punitive measure is ex post facto if it punishes past conduct which was not criminal when it occurred. It is also ex post facto if it increases the malignity of or possible penalty for past conduct which was criminal when it occurred. Lindsey v. Washington, 301 U.S. 397, 57 S.Ct. 797, 81 L.Ed. 1182 (1937).
State v. Quanrude, 222 N.W.2d 467, 469-70 (Iowa 1974).
A consecutive sentence is added to defendant's present sentence, whereas a concurrent sentence is served at the same time *29 as an existing sentence. Mandatory imposition of a consecutive sentence on defendant under this record causes the second sentence of section 901.8 to be an unconstitutional increase in the malignity of or possible penalty for past conduct which was criminal when it occurred.
"[T]he ex post facto clause looks to the standard of punishment prescribed by a statute, rather than to the sentence actually imposed." Lindsey v. Washington, 301 U.S. at 401, 57 S.Ct. at 799, 81 L.Ed. at 1186. Removal of the possibility of a concurrent sentence operates to defendant's "detriment in the sense that the standard of punishment adopted by the new statute is more onerous than that of the [prior law]." Id. The fact that it was discretionary to sentence defendant consecutively under the law in effect at the time defendant committed his crime does not prevent a retroactive application of a statute making such a sentence mandatory from being ex post facto.
The sentence of Smith cannot stand in view of the record. § 814.20, The Code 1979. We do not hold that the length of the sentence imposed by the court was improper or that the court may not impose a consecutive sentence on this defendant in the exercise of its discretion. We only hold that section 901.8 could not be used to mandate a consecutive sentence when its application would have an ex post facto effect on defendant.
We affirm the court of appeals disposition in that the conviction is affirmed and we vacate the sentence and remand the case to the trial court for resentencing.
JUDGMENT OF COURT OF APPEALS MODIFIED; CONVICTION AFFIRMED; SENTENCE VACATED; AND CASE REMANDED FOR RESENTENCING.
NOTES
[1]  Section 719.4(1) provides:

A person convicted of a felony, or charged with the commission of a felony, who intentionally escapes from any detention facility or institution to which the person has been committed by reason of such conviction or charge, or from the custody of any public officer or employee to whom the person has been entrusted, commits a class "D" felony.
[2]  Section 902.8 provides:

An habitual offender is any person convicted of a class "C" or a class "D" felony, who has twice before been convicted of any felony in a court of this or any other state, or of the United States. An offense is a felony if, by the law under which the person is convicted, it is so classified at the time of his or her conviction. A person sentenced as an habitual offender shall not be eligible for parole until he or she has served the minimum sentence of confinement of three years.
[3]  Defendant did not waive the ex post facto question due to not alerting the trial court to the issue. He had no way of knowing before the court entered judgment, whether the sentence would be consecutive or concurrent. "As defendant had no opportunity to preserve error, we could not, in fairness, hold that he waived it." State v. Marti, 290 N.W.2d 570, 589 (Iowa 1980).
