Judgments, Supreme Court, New York County (Budd G. Goodman, J.), rendered April 8, 2005, convicting defendant, upon his pleas of guilty, of rape in the first degree, robbery in the second degree, rape in the second degree (two counts) and endangering the *1144welfare of a child, and sentencing him, as a second violent felony offender, to an aggregate term of 20 years, unanimously modified, on the law, to the extent of vacating the supplemental sex offender fee, and otherwise affirmed.
Defendant knowingly and intelligently waived his right to appeal, and this waiver encompassed his excessive sentence claim (see People v Lopez, 6 NY3d 248 [2006]). In any event, were we to find that defendant did not validly waive his right to appeal, we would perceive no basis for reducing the sentence.
As the People concede, since the crime was committed prior to the effective date of the legislation (Penal Law § 60.35 [1] [b]) providing for the imposition of a supplemental sex offender fee, that fee should not have been imposed. Since this issue involves the substantive legality of the sentence, it survives defendant’s waiver of his right to appeal. Concur—Andrias, J.P, Friedman, Sullivan, Nardelli and Malone, JJ.