
    The People of the State of New York, Respondent, v Roger Miles, Appellant.
    [697 NYS2d 225]
   —Judgment unanimously affirmed. Memorandum: Defendant appeals from a judgment convicting him upon his plea of guilty of attempted criminal sale of a controlled substance in the third degree (Penal Law §§ 110.00, 220.39 [1]) and sentencing him as a second felony offender to an indeterminate term of imprisonment of 3 to 6 years.

There is no merit to defendant’s challenge to the validity of the waiver of the right to appeal. The plea colloquy establishes that defendant voluntarily, knowingly and intelligently waived the right to appeal (see, People v Lococo, 92 NY2d 825, 827; People v Callahan, 80 NY2d 273, 280). That waiver encompasses defendant’s contentions that evidence should have been suppressed and that police gave perjurious testimony before the Grand Jury (see, People v Lococo, supra, at 827; People v Hidalgo, 91 NY2d 733, 737).

Although defendant’s challenge to the legality of the sentence survives the waiver of the right to appeal (see, People v Seaberg, 74 NY2d 1, 10), there is no merit to the contention that the sentence was rendered illegal by the way in which the predicate felony issue was handled. During the CPL 400.21 procedure, defendant was properly advised of the consequences of either not contesting, or successfully challenging, the constitutionality of the predicate felony conviction. Thus, Supreme Court discharged its duty under the statute (see, CPL 400.21 [3], [7] [b]; see generally, People v Crippa, 245 AD2d 811, 812, lv denied 92 NY2d 850; People v Polanco, 232 AD2d 674, 675). (Appeal from Judgment of Supreme Court, Erie County, Forma, J. — Attempted Criminal Sale Controlled Substance, 3rd Degree.) Present — Denman, P. J., Green, Hayes, Pigott, Jr., and Scudder, JJ.  