Appeal from a judgment of the Niagara County Court (Richard C. Kloch, Sr., J.), rendered September 19, 2005.
PRESENT: HURLBUTT, J.P., MARTOCHE, FAHEY, CARNI, AND PINE, JJ.
The judgment convicted defendant, upon his plea of guilty, of attempted assault in the first degree. It is hereby ORDERED that the judgment so appealed from is unanimously affirmed. Memorandum: On appeal from a judgment convicting him upon his plea of guilty of attempted assault in the first degree (Penal Law §§ 110.00, 120.10 ), defendant contends that County Court erred in denying his motion to vacate the plea on the ground that he was mentally incompetent to enter the plea based on his posttraumatic stress disorder. We reject that contention (see generally People v Dover, 227 AD2d 804, lv denied 88 NY2d 984). Contrary to the further contention of defendant, he knowingly, intelligently and voluntarily waived his right to appeal (see People v Lopez, 6 NY3d 248, 256), and that valid waiver encompasses his challenge to the severity of the sentence (see People v Hidalgo, 91 NY2d 733, 737; People v Moore, 57 AD3d 1432, lv denied 12 NY3d 785). The challenge by defendant to the court's alleged error in sentencing him as a second violent felony offender does not survive his waiver of the right to appeal (see People v Hamilton, 49 AD3d 1163), inasmuch as defendant is essentially challenging the procedure pursuant to which he was sentenced as such, rather than the legality of the sentence (see generally People v Hicks, 201 AD2d 831, lv denied 83 NY2d 911; People v Rosado, 199 AD2d 833, 834-835, lv denied 83 NY2d 876). "Because the power of the court is not implicated by th[at] challenge, appellate review of [that challenge] is foreclosed by the bargained-for waiver of [the right to] appeal" (Rosado, 199 AD2d at 835). In any event, defendant failed to preserve his challenge for our review (see People v Myers, 52 AD3d 1229), and it lacks merit. Defendant was properly afforded notice of the predicate violent felony inasmuch as he received the predicate felony statement before he was sentenced (see People v Swan, 60 AD3d 1395), and the court's determination that defendant was a second violent felony offender is supported by proof beyond a reasonable doubt (see People v Williams, 30 AD3d 980, 983, lv denied 7 NY3d 852).