Appeal from a judgment of the Supreme Court, Erie County (Russell P Buscaglia, A.J.), rendered July 28, 2006. The judgment convicted defendant, upon his plea of gúilty, of criminal possession of a controlled substance in the third degree.
It is hereby ordered that the judgment so appealed from is unanimously modified on the law by vacating the DNA databank fee and as modified the judgment is affirmed.
Memorandum: Defendant appeals from a judgment convicting him, upon his plea of guilty, of criminal possession of a controlled substance in the third degree (Penal Law § 220.16 [1]). Contrary to the contention of defendant, the plea colloquy establishes that his waiver of the right to appeal was voluntarily, knowingly, and intelligently entered (see People v Lopez, 6 NY3d 248, 256 [2006]; People v Cox, 39 AD3d 1181 [2007]; People v Gilbert, 17 AD3d 1164 [2005], lv denied 5 NY3d 762 [2005]). That valid waiver of the right to appeal encompasses the further contention of defendant that Supreme Court erred in denying his request to be enrolled in the Comprehensive Alcohol and Substance Abuse Treatment program as part of his sentence, pursuant to Penal Law § 60.04 (6) (see generally. People v Muniz, 91 NY2d 570, 574-575 [1998]; People v Allen, 82 NY2d 761, 763 [1993]). In any event, the record establishes that the court did not abuse its discretion in denying defendant’s request (see Penal Law § 60.04 [6]; see People v Edell, 45 AD3d 461 [2007], lv denied 9 NY3d 1033 [2008]).
Although defendant failed to preserve for our review his contention that the court erred in imposing a $50 DNA databank fee pursuant to Penal Law § 60.35 (l) (a) (v), preservation is not required inasmuch as that contention concerns the legality of the sentence (see generally People v Fuller, 57 NY2d 152, 156 [1982]; People v Fomby, 42 AD3d 894, 896 [2007]). In addition, that contention is not encompassed by defendant’s waiver of the right to appeal (see People v Benavides, 19 AD3d 134, 135 [2005], lv denied 5 NY3d 850 [2005]; see also People v Figueroa, 17 AD3d 1130 [2005], lv denied 5 NY3d 788 [2005]). We agree with defendant that the imposition of a DNA databank fee is illegal because criminal possession óf a controlled substance in the third degree is not a designated offense for purposes of imposing such a fee (see Penal Law § 60.35 [1] [a] [v]; Executive Law § 995 [7] [b]). We therefore modify the judgment accordingly. Present—Hurlbutt, J.P., Smith, Lunn, Green and Gorski, JJ.