Appeal by the defendant from a judgment of the Supreme Court, Kings County (Ferdinand, J), rendered May 12, 2004, convicting him of criminal sale of a controlled substance in the third degree, upon his plea of guilty, and imposing sentence.
Ordered that the judgment is affirmed.
While on probation for two drug-related felonies, the defendant was arrested and indicted for selling heroin to an undercover officer within 1,000 feet of a school. He subsequently entered a plea of guilty to one count of criminal sale of a controlled substance in the third degree in full satisfaction of the indictment. The court promised that if he successfully completed a DTAP program (Drug Treatment Alternative-to-Prison Program), the plea would be vacated and the indictment would be dismissed. The court warned, however, that if he failed to complete the program, he would face a sentence of 4V2 to 9 years’ imprisonment as a second felony offender. The defendant was fully allocuted and, upon his admission, was adjudicated a second felony offender. He was subsequently discharged from one residential drug treatment program for noncompliance, and left a second residential program without permission and against clinical advice. He was thereafter arrested for another drug sale. The court sentenced him to a term of 4V2 to 9 years’ imprisonment.
The defendant’s purported waiver of his right to appeal from the sentence imposed was ineffective (see People v Brown, 13 AD3d 548 [2004]; People v Williams, 258 AD2d 544 [1999]; People v Rose, 236 AD2d 637 [1997]; People v Rolon, 220 AD2d 543 [1995]). Contrary to the defendant’s contention, however, the sentence was neither unconstitutional nor excessive (see People v Moore, 261 AD2d 421 [1999]; People v James, 251 AD2d 208 [1998]; People v Suitte, 90 AD2d 80 [1982]). Adams, J.P., Goldstein, Fisher and Lifson, JJ., concur.