
    C.B., a child, Appellant, v. STATE of Florida, Appellee.
    No. 98-1265.
    District Court of Appeal of Florida, First District.
    April 16, 1999.
    Nancy A. Daniels, Public Defender; Judith Dougherty Hall, Assistant Public Defender, Tallahassee, for Appellant.
    Robert A. Butterworth, Attorney General; Denise 0. Simpson, Assistant Attorney General, Tallahassee, for Appellee.
   VAN NORTWICK, J.

C.B., a juvenile, appeals a disposition order committing him to a moderate risk facility for an indeterminate period of time based upon appellant’s admission that he violated the conditions of community control. Because the trial court erred in imposing an indeterminate sentence, we reverse and remand for resentencing.

On February 27, 1997, C.B. was sentenced to community control following a plea to two first degree misdemeanors. On February 17, 1998, the state filed a petition for violation of community control pursuant to section 985.231(l)(c), Florida Statutes (1997). Although appellant admitted the violation at the sentencing hearing on March 13, 1998, appellant argued that the trial court lacked subject matter jurisdiction to sentence him further because such sentence would be imposed more than a year after the date of his original community control sentence. The trial court rejected appellant’s argument, finding that appellant had waived any subject matter jurisdiction claim because appellant had agreed at the time of the original sentencing that, if he did not successfully complete the assigned drug program, he would be subject to a moderate risk sentence.

We agree with appellant that the lack of subject matter jurisdiction cannot be waived. Francois v. State, 695 So.2d 695 (Fla.1997). Nevertheless, the trial court did not lose jurisdiction because the affidavit alleging a violation of community control was filed on February 12, 1998, which was within one year of imposition of the original sentence. Thus, the process of revocation was set in motion in a timely fashion. See T.M.B. v. State, 689 So.2d 1215 (Fla. 1st DCA 1997), approved, 716 So.2d 269 (Fla.1998); and see Tyson v. State, 655 So.2d 214 (Fla. 1st DCA 1995), and Hoffman v. State, 24 Fla. L. Weekly D566, 729 So.2d 421, 1999 WL 73696 (Fla. 1st DCA Feb.18, 1999).

However, we must reverse the sentence and remand for resentencing because, as the appellee correctly concedes, the appellant could not be sentenced for a period of time beyond one year or appellant’s 19th birthday, whichever first occurs. See M.J.P. v. State, 22 Fla. L. Weekly D2090, - So.2d -, 1997 WL 536011 (Fla. 1st DCA 1997), approved, 717 So.2d 459 (Fla.1998). In re-sentencing on remand, appellant is entitled to credit for the time he spent in secure detention awaiting disposition of the petition alleging a violation of community control. See E.R. v. State, 584 So.2d 158 (Fla. 2d DCA 1991).

REVERSED and REMANDED for farther proceedings.

BENTON AND PADOVANO, JJ., CONCUR.  