
121 Cal.Rptr.2d 918 (2002)
100 Cal.App.4th 184
The PEOPLE, Plaintiff and Respondent,
v.
Eric Lance NOBLE, Defendant and Appellant.
No. B149158.
Court of Appeal, Second District, Division Six.
July 16, 2002.
Rehearing Denied August 14, 2002.
Review Denied October 16, 2002.
*919 Kent Baker, under appointment by the Court of Appeal, San Diego, for Defendant and Appellant.
Bill Lockyer, Attorney General, Robert R. Anderson, Chief Assistant Attorney General, Pamela C. Hamanaka, Senior Assistant Attorney General, Ana R. Duarate, Erika D. Jackson, Deputy Attorneys General, for Plaintiff and Respondent.
YEGAN, Acting P.J.
Eric Lance Noble (defendant) appeals the judgment, by jury, extending his commitment as a mentally disordered offender (MDO) for one year, pursuant to Penal Code sections 2970 and 2972.[1] He contends the petition to extend his MDO commitment was untimely filed and that the trial court erred in its instructions concerning the effect of medication on his status as an MDO. We conclude the petition was timely filed, but agree that the trial court prejudicially erred when it allocated to defendant the burden to prove by a preponderance of the evidence that, as a result of medication, his mental disorder is in remission and he is not dangerous to others. Accordingly, we reverse.

Facts and Procedural History
Defendant was convicted of a felony assault in 1993 and was granted probation. In 1995, he was sentenced to state prison after violating the terms of his probation. Two years later he was certified an MDO *920 and admitted to Atascadero State Hospital where he has complied with his treatment plan by, among other things, taking the medications prescribed for him. However, he was argumentative, angry and at times violent toward staff and other patients. Defendant stipulated to the first extension of his MDO commitment in July 1999, but opposed the second such petition, filed in December 2000.
The trial court denied defendant's motion to dismiss the second extension petition as untimely. His theory at trial was that his mental disorder was controlled by medication and that he would not present a danger to others if released because he would continue to take his medication. The jury found that defendant met each of the statutory criteria. Accordingly, the trial court extended his MDO commitment for a period of one year. (§ 2972, subd. (0.)

Unreasonable Delay
Section 2972, subdivision (a) provides that the trial on a petition to extend an MDO commitment "shall commence no later than 30 calendar days prior to the time the person would otherwise have been released, unless the time is waived by the person or unless good cause is shown." Here, defendant's scheduled release date was January 15, 2001. The district attorney filed the petition to extend defendant's commitment on December 13, 2000. At a hearing on January 11, 2001, the trial court denied defendant's motion to dismiss the petition as untimely. Trial actually commenced on February 7, 2001.
We reject defendant's contention that the delay violated his right to due process. As the court held in People v. Williams (1999) 77 Cal.App.4th 436, 92 Cal.Rptr.2d 1, the 30-day trial deadline in section 2972, subdivision (a), "is directory and not mandatory[,]" and "is primarily designed to serve the interests of the public, rather than the MDO, by providing reasonable assurance that an MDO ... will not be released unless and until a determination is made that he or she does not pose a substantial danger to others." (Id. at p. 451, 92 Cal.Rptr.2d 1.) A trial commenced less than 30 days before an MDO's scheduled release date is not automatically invalid, nor does the trial court lose jurisdiction if trial commences after the deadline has passed. (Id. at pp. 451, 454, 92 Cal.Rptr.2d 1.)
Zachary v. Superior Court (1997) 57 Cal.App.4th 1026, 67 Cal.Rptr.2d 532, is not to the contrary. There, the district attorney delayed filing a petition to extend an MDO commitment until 24 days after the then-current term expired. The Court of Appeal issued a writ of mandate, directing the trial court to dismiss the petition because, it concluded, the statute did not authorize the filing of an extension petition after the MDO's commitment term expired, and because the resulting unauthorized confinement violated the MDO's right to due process. (Id. at p. 1037, 67 Cal.Rptr.2d 532.) Zachary is distinguishable from defendant's case because here the petition to extend defendant's MDO commitment was filed well before his prior term expired. (See, People v. Williams, supra, 77 Cal.App.4th at p. 455, 92 Cal. Rptr.2d 1.) Moreover, defendant has demonstrated no prejudice from the relatively brief delay at issue here. (See, e.g., People v. Fernandez (1999) 70 Cal.App.4th 117, 131, 82 Cal.Rptr.2d 469.) There was no deprivation of due process.

Instructional Error
The trial court instructed the jury: "It is the burden of the prosecution to prove beyond a reasonable doubt that the defendant meets the requirements for a hospital extension as defined in these instructions." *921 It then instructed the jury to determine whether defendant, "by reason of a mental disorder, not at this time in remission, represents a substantial danger of physical harm to others, [¶] The People have the burden of proving beyond a reasonable doubt that the respondent [defendant]: [¶] 1. Has a severe mental disorder; [¶] 2. Suffers from a severe mental disorder that is not in remission or cannot be kept in remission if the person's treatment is not continued; and [¶] 3. By reason of his severe mental disorder, the respondent [defendant] represents a substantial danger of physical harm to others." Quoting the statutory definition of the term, the trial court also instructed the jury that "`remission' means a finding that the overt signs and symptoms of the severe mental disorder are controlled either by psychotropic medication or psychosocial support ...."(§ 2962, subd. (a).)
The jury was further instructed in terms of CALJIC No. 4.15: "It is a defense to a Petition to Extend Commitment that the respondent [defendant] in a medicated state does not represent a substantial danger of physical harm to others. [¶] The ... [defendant] has the burden of proving by a preponderance of the evidence all of the facts necessary to establish: [¶] 1. In his present medicated condition he no longer represents a substantial danger of inflicting physical harm upon others; and [¶] 2. He will continue to take the medication as prescribed, in an unsupervised environment. [¶] If you find that the respondent [defendant] has met this burden on these issues, you should find that he does not represent a substantial danger of physical harm to others."
Defendant contends the trial court erred in allocating to him the burden of proving the so-called "medication defense." The People argue that the issue has been waived by defendant's failure to object below and that the instructions properly allocated the burden of proof on this affirmative defense to defendant. Because the claimed error affects defendant's substantial rights, it was not waived by the failure to object to the instruction. (§ 1259; People v. Flood (1998) 18 Cal.4th 470, 482, fn. 7, 76 Cal.Rptr.2d 180, 957 P.2d 869; People v. Collins (1992) 10 Cal.App.4th 690, 694-695, 12 Cal.Rptr.2d 768.) We also reject the contention that defendant asserted a true affirmative defense at trial. Defendant's claim that medication controls his mental disorder and renders him not dangerous challenges the essential "elements" of the petition. It does not introduce new, exculpatory matter. It is not, therefore, an affirmative defense.
An affirmative defense is one which does not negate an essential element of a cause of action or charged crime, but instead presents new matter to excuse or justify conduct that would otherwise lead to liability. (People v. Bolden (1990) 217 Cal.App.3d 1591, 1601, 266 Cal.Rptr. 724.) The burden to prove an affirmative defense may be imposed on the defendant in a criminal matter without violating his or her right to due process. (Id. at pp. 1600-1601, 266 Cal.Rptr. 724; Martin v. Ohio (1987) 480 U.S. 228, 107 S.Ct. 1098, 94 L.Ed.2d 267.) Where a "defense" negates an essential element of the crime charged rather than introducing new matter, however, "the state may not constitutionally place the burden of persuasion on that issue upon the defendant." (People v. Bolden, supra, 217 Cal.App.3d at p. 1601, 266 Cal.Rptr. 724, citing People v. Babbitt (1988) 45 Cal.3d 660, 694, 248 Cal.Rptr. 69, 755 P.2d 253.)
In People v. Bolden, supra, 217 Cal. App.3d at pages 1601-1602, 266 Cal.Rptr. 724, the court of appeal held that, at the trial on a section 1026.5 petition to extend the commitment of a defendant found not *922 guilty by reason of insanity, the defendant may be entitled to a jury instruction on the "affirmative defense" that he is not dangerous while on medication. The Bolden court concluded that medication is an affirmative defense to a section 1026.5 petition because a defendant could meet each of the statutory criteria for continued commitment and still be entitled to release if the jury found the elements of the defense to be true. (Id.)
CALJIC No. 4.15, the instruction at issue here, is derived from the holding in Bolden. The instant case, however, involves a distinct statutory scheme. (People v. Tate (1994) 29 Cal.App.4th 1678, 1682-1683, 35 Cal.Rptr.2d 250.) Under the MDO statute, defendant's commitment may not be extended unless the prosecution proves, beyond a reasonable doubt, that he has a severe mental disorder that is not in remission or cannot be kept in remission without treatment, and that, as a result of the disorder, defendant represents a substantial danger of physical harm to others. (§ 2970; § 2972, subd.(c).) A mental disorder is in remission if its symptoms are controlled by medication. (§ 2962.) Thus, an MDO whose symptoms are controlled by medication and who is not dangerous while on medication is by definition "in remission," and represents no danger to others. Such a person does not meet the statutory criteria for an extension of his or her MDO commitment. (§§ 2962, 2972, subd. (c).) Defendant's medication "defense," therefore, amounts to a claim that he does not meet two of the three criteria for extending his MDO commitment because he is in remission and is not dangerous. These are issues upon which the prosecution must bear the burden of proof.
The trial court erred by giving an "affirmative defense" instruction imposing on defendant the burden to prove by a preponderance of the evidence that he is in remission and thus not dangerous to others while medicated. (People v. Bolden, supra, 217 Cal.App.3d at pp. 1600-1602, 266 Cal.Rptr. 724.) Where, as here, an MDO defends on such a theory, the trial court should instruct the jury as follows: The People have the burden to prove, beyond a reasonable doubt, that if released, the defendant will not take his or her prescribed medication and in an unmedicated state, the defendant represents a substantial danger of physical harm to others.

Harmless Error
The People urge us to find the instructional error harmless because the jury was properly instructed on the statutory criteria for extending defendant's MDO commitment and because the evidence is overwhelming that he meets those criteria. There was evidence that defendant believes he does not need medication, dislikes its side effects, and will relapse if he stops taking it. Defendant's treatment professionals opined that, without treatment and supervision, he would discontinue the medication and would "become more aggressive, would hear voices, maybe his [dead] mother again, telling him to do things, and he would act out." Based on this evidence, a properly instructed jury could reasonably conclude that defendant meets the statutory criteria for an extension of his MDO commitment.
The question here, however, is not whether a reasonable jury might have found that defendant met the statutory criteria. The trial court provided the jury with conflicting instructions on the burden of proof. To affirm, we must "be able to declare a belief that [the instructional error] was harmless beyond a reasonable doubt." (Chapman v. California (1967) 386 U.S. 18, 24, 87 S.Ct. 824, 17 L.Ed.2d *923 705.) This requires us to find that "`"the error complained of did not contribute to the verdict obtained[,]"'" because it was "unimportant in relation to everything else the jury considered on the issue in question." (People v. Flood (1998) 18 Cal.4th 470, 494, 76 Cal.Rptr.2d 180, 957 P.2d 869, quoting Yates v. Evatt (1991) 500 U.S. 391, 403, 111 S.Ct. 1884, 114 L.Ed.2d 432, quoting Chapman v. California, supra, 386 U.S. at p. 24, 87 S.Ct. 824.) As the Supreme Court held in Sullivan v. Louisiana (1993) 508 U.S. 275, 113 S.Ct. 2078, 124 L.Ed.2d 182, "Harmless-error review looks ... to the basis on which `the jury actually rested its verdict.' [Citation.] The inquiry, in other words, is not whether, in a trial that occurred without the error, a guilty verdict would surely have been rendered, but whether the guilty verdict actually rendered in this trial was surely unattributable to the error." (Id. at p. 279, 113 S.Ct. 2078.) We cannot say that it was.
Here, the jury received contradictory instructions allocating first to the People and then to defendant the burden to prove the only contested issue at trial: whether, as a result of medication, defendant is in remission and is not dangerous. First, the jury was instructed that the People bear the burden to prove beyond a reasonable doubt that defendant is not in remission and is dangerous. Next, it was instructed that defendant bears the burden to prove by a preponderance of the evidence that he is in remission and is not dangerous. Under these contradictory instructions, the jury found defendant met the statutory criteria to extend his commitment as an MDO. It is not possible to determine whether the jury reached this conclusion because it found that the People carried their burden of proof, or because it found that defendant failed to carry his. Under these circumstances, we cannot say the error was harmless beyond a reasonable doubt. (Id.)
The judgment (order to extend commitment) is reversed.
We concur: COFFEE and PERREN, JJ.
NOTES
[1]  All statutory references are to the Penal Code unless otherwise stated.
