— Judgment unanimously reversed, motion to withdraw plea granted and matter remitted to Supreme Court, Erie County, for further proceedings in accordance with the following memorandum: On July 7, 1974 defendant pleaded guilty to robbery, third degree in satisfaction of various charges pending in Supreme and City Courts. Prior to accepting the plea the court advised defendant that robbery, third degree, "being a Class D felony, the sentence in this matter can be from three to seven years in a state prison.” The admonition was repeated when the court later stated, "You appreciate that you can receive a sentence from three to seven years in a state prison.” On both occasions defendant responded that he understood. The plea was accepted and a sentencing date set. The day before sentencing, a notice pursuant to GPL 400.21 was sent to defendant alleging that he was a second felony offender and informing him that he was entitled to a hearing to controvert the allegations of the notice and that uncontroverted statements in the notice would be deemed admitted. At the time of *721sentencing, defendant appeared with counsel and moved to withdraw his plea of guilty on the grounds that he had not been advised and did not understand at the time of pleading that he was subject to a mandatory minimum term of imprisonment as a second offender. A hearing was held at which defendant testified that he had served time at Elmira, but that he believed that sentence was upon a youthful offender adjudication and not a prior felony. (In a pro se brief on this appeal, defendant makes the same erroneous contention.) Nevertheless, the record does not reveal that the facts or constitutionality of the predicate felony were investigated or considered at the hearing. Defendant’s motion to withdraw the plea was denied and defendant was sentenced as a second felony offender to a term of imprisonment of three and one-half to seven years. The record does not indicate that either the court or counsel advised defendant before his plea that he would be treated as a second felony offender or subject to a mandatory minimum term of imprisonment. The court did not refer to a mandatory minimum and defendant and his counsel deny that they were aware of the prospect of such a sentence at the time of defendant’s plea. The second offender notice may be served after the acceptance of the plea and before sentencing (CPL 400.21, subd 2). However, when the possibility of second offender sentence exists, the court should be cautious when accepting the plea to insure that defendant’s plea is voluntary in the sense that he understands the possible penal sanctions to which he is subject, (People v Nixon, 21 NY2d 338, 345). When, as here, defendant denies that he understood that and particularly when he effectively indicates that he questions the prior felony, he should be permitted to withdraw his plea. No hearing was held on the allegations in the second offender statement and defendant asserts this ground for reversal also. The People contend that there was substantial compliance with the statute and that the burden of controverting the conviction rests on defendant (People v Bryant, 47 AD2d 51). However, in the Bryant cases, in each instance the court, at the plea hearing and before the plea was accepted, specifically directed defendant’s attention to the consequences of a prior felony conviction, each defendant was represented by knowledgeable counsel, and the court questioned defendant on the facts of the predicate felony and correctly stated the mandatory minimum sentence defendant could expect if he pleaded guilty. The irregularities complained of in those appeals were the failure by the District Attorney to serve notices on three of the defendants and the failure to advise others that they were entitled to a hearing, even though they had orally admitted the predicate felonies. The court held that the irregularities were cured by the in-court proceedings and there had been substantial compliance with the statute. In this case, the notice was properly served and contained directions to defendant that he had the burden of controverting the allegations. Upon the hearing he effectively, if not specifically, addressed the validity of the predicate felony the People relied upon for sentencing purposes and a hearing on that subject was required under CPL 400.21. The judgment is reversed, the motion to withdraw the plea is granted, and the matter remitted for further proceedings. (Appeal from judgment of Supreme Court, Erie County, convicting defendant of robbery, third degree.) Present —Marsh, P. J., Simons, Mahoney, Goldman and Del Vecchio, JJ.