
586 P.2d 1085 (1978)
92 N.M. 256
STATE of New Mexico, Plaintiff-Appellee,
v.
Simon MARTINEZ, Defendant-Appellant.
No. 11838.
Supreme Court of New Mexico.
November 8, 1978.
Rehearing Denied December 1, 1978.
*1086 Theodore E. Lauer, Santa Fe, for defendant-appellant.
Toney Anaya, Atty. Gen., Michael E. Sanchez, Asst. Atty. Gen., Santa Fe, for plaintiff-appellee.

OPINION
PAYNE, Justice.
Defendant Simon Martinez was convicted of criminal sexual penetration in the second-degree and of a separate charge of armed robbery. He was sentenced to a term of ten to fifty years for each offense. The court ordered that the terms be served consecutively. Thereafter, habitual offender charges were filed against him based on these two convictions and three previous convictions. Defendant was tried and convicted on the habitual offender charges and was resentenced to two consecutive life sentences pursuant to § 40A-29-5 C, N.M.S.A. 1953 (Repl. 1972) (repealed by Laws 1977, ch. 216, § 17, effective July 1, 1979).
Defendant raises three issues on appeal from his conviction of and sentencing on the habitual offender charges: (1) Whether the trial court erred in refusing to submit to the jury the issue of the alleged invalidity of two of defendant's prior convictions; (2) whether consecutive life sentences may be imposed under § 40A-29-5 C; and (3) whether defendant was properly credited with time he served on the original vacated sentences. We affirm the trial court on the first two issues, but remand the case for the purpose of crediting defendant for time he served prior to his conviction in the habitual offender proceedings.

I. Validity of Prior Convictions

At his trial on the habitual offender charges, defendant attempted to introduce evidence to show that his guilty pleas to burglary charges in 1964 and 1969 were entered as a result of coercion by law enforcement officers, and were therefore involuntary. The proffered evidence consisted of the testimony of the attorney who represented defendant on the two burglary charges and the defendant's own testimony. The trial court heard the testimony, ruled that the validity of the prior convictions was a question of law which was not to be submitted to the jury, and held that the challenged convictions were valid.
Section 40A-29-7, N.M.S.A. 1953 (Repl. 1972) (repealed by Laws 1977, ch. 216, § 17, effective July 1, 1979) provides for trial by jury in habitual proceedings. That section requires the jury to decide two issues: (1) Whether the defendant in an habitual proceeding is "the same person mentioned in the several records as set forth in the information"; *1087 and (2) whether the defendant has been convicted of the previous crimes as charged.
Defendant contends that because the jury must decide whether defendant was previously convicted of the crimes set forth in the habitual offender information, it must also determine whether those prior convictions were legally valid. We do not agree.
The constitutional validity of the prior convictions upon which the habitual offender charges are brought is subject to attack in an habitual offender proceeding. State v. Dalrymple, 75 N.M. 514, 407 P.2d 356 (1965); State v. Dawson, 91 N.M. 70, 570 P.2d 608 (Ct.App. 1977). However, we cannot subscribe to the view that all issues of validity are to be decided by the jury in such a proceeding. This is particularly the case where the attack on the prior convictions goes to the validity of defendant's guilty pleas. The Court of Appeals stated in State v. Gallegos, 91 N.M. 107, 111, 570 P.2d 938, 942 (Ct.App. 1977):
It is the trial court that determines whether a guilty plea is voluntary. Rule of Crim. Proc. 21(f). It is the trial court that determines whether a plea of guilty may be withdrawn. State v. Kincheloe, 87 N.M. 34, 528 P.2d 893 (Ct.App. 1974). Similarly, the trial court should determine whether a guilty plea is invalid.
Defendant contends that this problem is analogous to the manner in which allegations that a confession was involuntary are decided. In such a case the trial judge makes a preliminary determination of the issue, and if he concludes that it was voluntarily given, the defendant may have the issue submitted to the jury for a final determination. Jackson v. Denno, 378 U.S. 368, 84 S.Ct. 1774, 12 L.Ed.2d 908 (1964); State v. Burk, 82 N.M. 466, 483 P.2d 940 (Ct.App. 1971), cert. denied, 404 U.S. 955, 92 S.Ct. 309, 30 L.Ed.2d 271 (1971); N.M.U.J.I. Crim. 40.40 [Vol. 6, N.M.S.A. 1953 (Supp. 1975), at 324]; N.M.R.Evid. 104(c) [§ 20-4-104(c), N.M.S.A. 1953 (Supp. 1975)]. Defendant argues that the voluntariness of a guilty plea to an offense which is relied upon to support an habitual offender charge should be decided in the same manner.
There are two significant differences between proceedings to determine voluntariness of confessions and voluntariness of pleas. The first difference lies in the manner in which guilty pleas are entered. Unlike confessions, guilty pleas are made before an impartial magistrate in a judicial forum with a verbatim record. Such pleas may not be accepted by the court unless a defendant is informed of the nature of the charges against him, the penalties that may be imposed, his right to plead not guilty and the fact that he relinquishes his right to trial by jury by so pleading. N.M.R.Crim.P. 21(e) [§ 41-23-21(e), N.M.S.A. 1953 (Supp. 1975)]. Furthermore, the court must determine from the defendant himself whether the plea is voluntary, and whether it is the result of force, threats, or promises. N.M.R.Crim.P. 21(f) [§ 41-23-21(f), N.M.S.A. 1953 (Supp. 1975)]. Any failure to comply would be grounds for appeal. No such safeguards are present at the time extrajudicial confessions are made.
The second major difference lies in the nature of the proceedings in which the issue arises. The determination of the admissibility of confessions is made in a judicial proceeding to determine the defendant's guilt or innocence of the charges to which the alleged confession relates. Matters other than the confession may also be presented to the jury in determining guilt or innocence and may affect the determination. In an habitual offender proceeding, the function of the jury is set forth in § 40A-29-7. Here defendant seeks to retry in an habitual offender proceeding the question of voluntariness of guilty pleas he made a decade ago. Although the validity of the prior convictions upon which the habitual offender charge is based is subject to attack in such a proceeding, the purpose of § 40A-29-7 was not to provide a defendant with a trial by jury on previous convictions where the defendant waived such a trial in the original criminal proceedings.
*1088 The trial court did not err in refusing to submit the question of the voluntariness of defendant's guilty pleas to the jury.

II. Imposition of Consecutive Life Sentences

Defendant contends that the imposition of consecutive life sentences following his conviction in the habitual offender proceedings was error in light of § 42-1-59, N.M.S.A. 1953 (Repl. 1972).
Section 42-1-59 provides:
Whenever any convict shall have been committed under several convictions with separate sentences, they shall be construed as one continuous sentence for the full length of all the sentences combined.
Where a person received eight consecutive sentences each for a term of not less than one nor more than five years, it has been held that the sentence must be considered one continuous sentence of not less than eight nor more than forty years. Deats v. State, 84 N.M. 405, 503 P.2d 1183 (Ct.App. 1972).
Defendant argues that since multiple sentences can never exceed a single life, § 42-1-59 cannot affect his sentences, and consecutive life sentences are therefore meaningless. He contends that his parole eligibility will accrue in ten years under § 41-17-24(D)(4), N.M.S.A. 1953 (Inter. Supp. 1976-77).
Consecutive life sentences have meaning as they relate to the time that must be served before becoming eligible for parole under § 41-17-24(D)(4). We do not construe the statutory scheme of sentencing adopted by the Legislature to mandate eligibility for parole on consecutive life sentences at the same time as if a defendant had committed a single such crime. In the absence of more specific statutory language evidencing a contrary legislative intent, we hold that consecutive life sentences may be imposed.

III. Deduction for Time Served

Defendant contends that the trial court failed to properly credit him under § 40A-29-7 for the time he served on the original vacated sentences upon which the habitual charges were based.
The original sentences commenced as of the date of sentencing, February 2, 1977. On January 20, 1978 these sentences were vacated and the life sentences were imposed. The commitment to the State Penitentiary expressly provided that the life sentences were to begin as of that date. Therefore, it appears from the record that defendant did not receive the credit to which he was entitled under § 40A-29-7 for time served between February 2, 1977 and January 20, 1978.
Under § 40A-29-25, N.M.S.A. 1953 (Repl. 1972) defendant was also entitled to credit on his sentences for any period he spent in confinement on these charges prior to imposition of the original sentences on February 2, 1977. It would appear that such credit was not given, although the record is not clear as to what time was actually served.
The State contends that if it is not clear whether defendant received proper credit, this issue should be raised in a post-conviction proceeding under N.M.R.Crim.P. 57 [§ 41-23-57, N.M.S.A. 1953 (Supp. 1975)]. However, since proper credit may be given on remand of this case to the trial court, there is no reason why defendant should be forced to re-litigate the matter in a new forum at a later date. But see State v. DeSantos, 91 N.M. 428, 575 P.2d 612 (Ct. App. 1978).
The convictions of the habitual offender charges and the imposition of consecutive life sentences are affirmed. The case is remanded to the trial court for the purpose of crediting defendant for the time he has served as required by §§ 40A-29-7 and 40A-29-25.
IT IS SO ORDERED.
McMANUS, C.J., and EASLEY, J., concur.
