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 4½ 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 4½ 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; People v. Rose, 236 AD2d 637; People v. Rolon, 220 AD2d 543). Contrary to the defendant's contention, however, the sentence was neither unconstitutional nor excessive ( see People v. Moore, 261 AD2d 421; People v. James, 251 AD2d 208; People v. Suitte, 90 AD2d 80).