Appeal from a judgment of the Supreme Court, Erie County (Ronald H. Tills, A.J.), rendered February 13, 2004. The judgment convicted defendant, upon his plea of guilty, of rape in the third degree and sodomy in the third degree.
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 Supreme Court, Erie County, for further proceedings in accordance with the following memorandum: Defendant appeals from a judgment convicting him upon his plea of guilty of rape in the third degree (Penal Law § 130.25 [2]) and sodomy in the third degree (former § 130.40 [2]). We agree with defendant that his waiver of the right to appeal was not knowingly, voluntarily and intelligently entered. Supreme Court’s reference to defendant’s right to appeal does not establish that the court “ ‘engage [d] the defendant in an adequate colloquy to ensure that the waiver of the right to appeal was a knowing and voluntary choice’ ” (People v Brown, 296 AD2d 860, 860 [2002], lv denied 98 NY2d 767 [2002]; see People v Fehr, 303 AD2d 1039, 1039-1040 [2003], lv denied 100 NY2d 538 [2003]). In any event, a valid waiver of the right to appeal would not preclude defendant’s challenge to the severity of the sentence herein because the court failed to advise defendant of the potential maximum term of incarceration (see Fehr, 303 AD2d at 1040; People v Cormack, 269 AD2d 815 [2000]). Although we conclude that the sentence of incarceration is not unduly harsh or severe, we further conclude, and the People correctly concede, that the order of protection must be amended by limiting its duration because the court failed to take into ac*1344count any jail time credit to which defendant is entitled (see CPL 530.13 [4] [ii]; People v Victor, 20 AD3d 927 [2005]; People v Grice, 300 AD2d 1005, 1006 [2002], lv denied 99 NY2d 654 [2003]). Defendant failed to preserve for our review his contention with respect to the duration of the order of protection, and thus we exercise our power to review his contention 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 Supreme Court to determine the jail time credit to which defendant is entitled and to specify in the order of protection an expiration date that is three years from the date of expiration of the maximum term of the sentence (see Victor, 20 AD3d at 928; Grice, 300 AD2d at 1006). Present—Pigott, Jr., P.J., Gorski, Martoche, Pine and Lawton, JJ.