Defendant was convicted of a felony ■committed in Bernalillo County, New Mexico, on October 7, 1965. A supplemental information charged that defendant was the person convicted of felonies committed in the same county on December 5, 1956, and April 19, 1961. A jury found defendant to be the person so convicted in 1956 and 1961. Judgment was entered imposing sentence as an habitual offender under § 40A-29-5, N.M.S.A.1953.
Defendant’s appeal attacks the validity of the two prior convictions. He contends: (1) that he did not have a preliminary examination in connection with the two prior convictions and (2) that the first conviction was for a misdemeanor rather than a felony. Such a collateral attack is permissible. State v. Dalrymple, 75 N.M. 514, 407 P.2d 356.
Defendant did not have a preliminary hearing in connection with either the 1956 or 1961 charges.
In the 1956 case defendant entered a plea of not guilty to the information. Subsequently he was tried and convicted by a jury. Defendant was represented by counsel throughout the 1956 proceeding.
The record of the 1961 proceeding is not included in the transcript. However, the uncontradicted testimony at the habitual offender proceeding is that defendant pled guilty to the 1961 information, and that he was represented by counsel in those proceedings.
Defendant asserts that his right under Article II, § 14 of the Constitution of New Mexico has been violated. The applicable portion reads:
“ * * * No person shall be so held on information without having had a preliminary examination before an examining magistrate, or having waived such preliminary examination.”
“ * * * The constitutional right is a guaranty against being held to answer. *673* * *” State v. Vigil, 33 N.M. 365, 266 P. 920.
“ * * * [I]t is and has been the law in New Mexico for many years that the right to have a preliminary hearing may he and is waived upon entry of a plea in district court. State v. Gallegos, 46 N.M. 387, 129 P.2d 634. * * * ” Sanders v. Cox, 74 N.M. 524, 395 P.2d 353.
In the 1956 case, defendant entered a plea of not guilty “without waiving right to a preliminary hearing.” The trial court ordered that defendant be granted a preliminary hearing, but also accepted the plea. A similar situation occurred in State v. Bailey, 62 N.M. 111, 305 P.2d 725. In Bailey the examination was held subsequent to the plea. The court stated that the defendant:
but he waived this right by his plea. State v. Gallegos, 46 N.M. 387, 129 P.2d 634; State v. Trujillo, 33 N.M. 370, 266 P. 922; State v. Vigil, 33 N.M. 365, 266 P. 920.” (Our Emphasis)
The entry of a plea after intelligent waiver of counsel or when represented by competent counsel serves as a waiver of the right to a preliminary exam-State v. Blackwell, 76 N.M. 445, 415 P.2d 563. If defendant wished to preserve his right to a preliminary examination, he should have refused to plead until the examination was held. See State ex rel. Hanagan v. Armijo, 72 N.M. 50, 380 P.2d 196.
Defendant’s claim that his first conviction was a misdemeanor is made on the basis of changes in § 40-21-8, N.M.S.A.1953. This section pertains to fraudulent checks. When enacted by Laws 1953, Chapter 132, it provided that issuance of fraudulent checks was a felony if the check was for $20.00 or more. An amendment in 1961 (Laws 1961, Chapter 206) made a violation of this section a felony if the check was $50.00 or more. Laws 1963, Chapter 315, enacted a new “Worthless Check Act” which is § 40-49-1 through § 40-49-9, N.M.S.A.1953. Section 10 of the 1963 law repealed § 40-21-8, N.M.S.A.1953.
In this appeal we are only concerned with § 40-21-8, N.M.S.A.1953, as it existed in 1956. If defendant’s violation of that section was a felony in 1956, changes in or repeal of the statute subsequent to 1956 do not preclude the use of that conviction in prosecutions under our habitual offender statute. See 19 A.L.R.2d 235.
At the time the offense was committed on June 2, 1956, and at the time defendant was convicted on December 5, 1956, it was a felony to issue a fraudulent check in the amount of $20.00 or more. Defendant was *674convicted under. Count 2 of the information which charged' issuance of a .fraudulent check in .the amount: of $46!50. He was convicted of a felony.
The judgment is affirmed. It is so ordered.
NOBLE and COMPTON, JJ., concur.