Because Welfare and Institutions Code section 733, subdivision (c) allows commitment to the Department of Corrections and Rehabilitation, Division of Juvenile Facilities (DJF), only when the most recent offense alleged in a petition is one listed in Welfare and Institutions Code section 707, subdivision (b) or is a sex offense listed in Penal Code section 290, dismissal of a non-qualifying sustained petition to reach an earlier qualifying sustained petition may result in an abuse of discretion. In 2005, V.C. admitted a petition alleging oral copulation with a minor (Pen. Code, sec. 288a, subd. (b)(1)), and was adjudged a ward of the court. On September 1, 2007, Welfare and Institutions Code section 733 was amended to allow commitment to DJF only where the most recent offense alleged in a petition and admitted or found true is one that is listed in section 707, subdivision (b), or in Penal Code section 290. In November 2007, the district attorney filed a petition alleging V.C. had committed one section 733 qualifying offense and one that was not. In a plea bargain approved by the court, V.C. admitted the non-qualifying offense and the remainder of the petition was dismissed with V.C. continued a ward of the court with a condition ordering him to complete sex offender treatment. In February 2008, a section 777 action was filed alleging V.C. failed to participate in treatment. On motion of the district attorney, the court dismissed the 2007 petition so as to make the most “recent” offense one that made V.C. eligible for DJF. In a petition for writ of mandate, the appellate court ruled that this action was an abuse of discretion as it denied V.C. his due process rights to the benefits of his plea bargain and was contrary to the intent and legislative history of section 733 with its focus on the most “recent” offense.