
    The People of the State of New York, Respondent, v Samuel Mingo, Appellant.
    [832 NYS2d 721]
   Appeal from a judgment of the Erie County Court (Michael E Pietruszka, J.), rendered December 13, 2005. The judgment convicted defendant, upon his plea of guilty, of assault in the second degree and driving while intoxicated.

It is hereby ordered that the judgment so appealed from be and the same hereby is unanimously modified as a matter of discretion in the interest of justice and on the law by amending the order of protection and as modified the judgment is affirmed, and the matter is remitted to Erie County Court for further proceedings in accordance with the following memorandum: On appeal from a judgment convicting him upon his guilty plea of, inter aha, assault in the second degree (Penal Law § 120.05 [4]), defendant contends that his waiver of the right to appeal was not knowingly, intelligently and voluntarily entered. We reject that contention (see People v Calvi, 89 NY2d 868, 871 [1996]). The valid waiver by defendant of the right to appeal does not encompass his contention with respect to the severity of the sentence, however, because the record establishes that defendant waived his right to appeal before County Court advised him of the potential periods of imprisonment that could be imposed (see People v McLean, 302 AD2d 934 [2003]; see generally People v Lococo, 92 NY2d 825, 827 [1998]). We conclude that the sentence is not unduly harsh or severe.

We agree with defendant, however, that the court erred in setting the expiration date of the order of protection without “taking into account [the] jail time credit to which defendant is entitled” (People v Viehdeffer, 288 AD2d 860, 860 [2001]). Although defendant failed to preserve that contention for our review (see People v Nieves, 2 NY3d 310, 315-317 [2004]), we exercise our power to review it as a matter of discretion in the interest of justice (see CPL 470.15 [6] [a]). We therefore modify the judgment by amending the order of protection, and we remit the matter to County Court to determine the jail time credit to which defendant is entitled and to specify in the order of protection an expiration date in accordance with CPL 530.12 (5). Present—Gorski, J.P, Centra, Lunn, Peradotto and Pine, JJ.  