
116 Cal.Rptr.2d 336 (2002)
95 Cal.App.4th 1218
The PEOPLE, Plaintiff and Respondent,
v.
Michael James BADURA, Defendant and Appellant.
No. E028780.
Court of Appeal, Fourth District, Division Two.
February 5, 2002.
Review Denied May 15, 2002.[**]
*338 Chris Truax, under appointment by the Court of Appeal, San Diego, for Defendant and Appellant.
Bill Lockyer, Attorney General, Robert R. Anderson, Chief Assistant Attorney General, Gary W. Schons, Senior Assistant Attorney General, Janelle Boustany, Supervising Deputy Attorney General, and Bradley A. Weinreb, Deputy Attorney General, for Plaintiff and Respondent.
Certified for Partial Publication.[*]


*337 OPINION
RICHLI, J.
Defendant Michael James Badura appeals from an order extending his original commitment as a sexually violent predator for an additional two years. His sole contention is that he was entitled to dismissal because he was kept in custody beyond his original commitment without a finding of probable cause.
We disagree. When defendant first raised this issue in the trial court, by making a motion to dismiss, the trial court immediately made a preliminary finding of probable cause and ordered that defendant continue to be kept in custody. We will hold that the Legislature did not intend the trial court's failure to make this determination three days earlier, when defendant's original term expired, to be grounds for dismissal.

I

FACTUAL AND PROCEDURAL BACKGROUND
In 1985, defendant was convicted of committing lewd and lascivious acts, many of them by force, upon two girls not related to him (as well as upon his nephew and his own son). He was sentenced to prison. He was scheduled to be released in April 1997. However, in March 1997, the People filed a petition to commit him as a sexually violent predator. On October 2, 1997, he was found to be a sexually violent predator, and he was committed for two years. Thus, his original commitment was due to end on October 2,1999.
On August 18, 1999, the People filed a petition to extend defendant's commitment. A probable cause hearing was set for October 5, 1999. On that date, defendant moved to dismiss the petition on the ground that his commitment had expired before a probable cause hearing had been held. The trial court set a hearing on the motion for October 28, 1999. It indicated that it would conduct the probable cause hearing, if at all, after it ruled on the motion. Pursuant to Welfare and Institutions Code section 6601.5, however, it found that the petition supported a finding of probable cause. It therefore ordered that defendant remain detained.
On October 28, 1999, after a further hearing, the trial court denied the motion to dismiss. It set the probable cause hearing *339 for November 8, 1999. Although there was a hearing on November 8, 1999, it appears that the probable cause hearing was either continued or taken off calendar; indeed, it does not appear that a probable cause hearing was ever held. In this appeal, however, defendant does not assert that this was error.
On September 11, 2000, defendant waived a probable cause hearing as well as a jury trial. On November 17, 2000, the trial court found that he was still a sexually violent predator. It therefore committed him for another two years, beginning retroactively on October 2, 1999, and ending on October 2, 2001.

II

STATUTORY BACKGROUND
The Sexually Violent Predator Act (the Act) (Welf. & Inst.Code, § 6600 et seq.) provides for a two-year involuntary commitment of a "sexually violent predator," which is generally defined as a person who has been convicted of violent sex crimes against multiple victims and who, by reason of a diagnosed mental disorder, is likely to engage in sexually violent criminal behavior so as to constitute a danger to the health and safety of others. (Welf. & Inst.Code, § 6600, subd. (a)(1).)

A. Initial Commitment Procedures.

If the Department of Corrections determines, based on a standardized screening, that a prisoner in its custody may be a sexually violent predator, it may refer that person for evaluation. (Welf. & Inst.Code, § 6601, subds. (a)(1), (b).) In most cases, the referral should be made at least six months before the prisoner's scheduled release date. (Welf. & Inst.Code, § 6601, subd. (a)(1).) However, if necessary for the completion of a full evaluation, the Board of Prison Terms may keep the prisoner in custody for up to 45 days beyond his or her scheduled release date. (Welf. & Inst.Code, § 6601.3.)
If two psychologists or psychiatrists both agree, based on a standardized assessment protocol, that the prisoner is a sexually violent predator, the district attorney may file an initial commitment petition. (Welf. & InstCode, § 6601, subds. (c), (d), (h), (i).) The Act provides that the defendant must be in custody when the initial petition is filed. However, it also provides that "[a] petition shall not be dismissed on the basis of a later judicial or administrative determination that the individual's custody was unlawful, if the unlawful custody was the result of a good faith mistake of fact or law." (Welf. & Inst. Code, § 6601, subd. (a)(2).)
A probable cause hearing must be held. This is a full adversarial evidentiary hearing. (People v. Butler (1998) 68 Cal.App.4th 421, 432-435, 80 Cal.Rptr.2d 357, cert. den. (1999) 528 U.S. 865, 120 S.Ct. 160, 145 L.Ed.2d 136; In re Parker (1998) 60 Cal.App.4th 1453, 1466-1470, 71 Cal.Rptr.2d 167.) At the end of the hearing, the trial court must determine, as a factual matter, whether there is probable cause to believe that the defendant is likely to engage in sexually violent predatory criminal behavior upon release. Once the probable cause hearing has begun, the defendant must remain in custody until it is over. If the trial court determines that there is probable cause, it must order that a trial be held; it also must order that the defendant remain in custody until the trial is over. (Welf. & Inst.Code, § 6602, subd. (a).)
Under Welfare and Institutions Code section 6601.5, as it stood in 1999, if the defendant's parole was about to expire before a probable cause hearing could be held, the People could request an "urgency *340 review." The trial court then had to determine whether the petition, on its face, would support a finding of probable cause to believe that the defendant was likely to engage in sexually violent predatory criminal behavior upon release. If the trial court made this preliminary finding of probable cause, it had to order the defendant detained until a probable cause hearing could be held; in that event, the probable cause hearing had to begin not more than 10 days later. (Former Welf. & Inst. Code, § 6601.5, Stats.1998, ch. 19, § 2, pp. 105-106.)
Welfare and Institutions Code section 6601.5, as it now stands, is essentially identical, except that it allows the People to request such a review in all cases, not just when the defendant's parole is about to expire. It therefore refers to it as a "review," rather than an "urgency review."
Finally, at the trial, a jury (or the trial court, if neither side demands a jury) must determine whether the defendant is a sexually violent predator. (Welf. & Inst. Code, §§ 6603, subds. (a), (b), (d), 6604.) If so, he or she must be committed to the custody of the State Department of Mental Health for two years. (Welf. & Inst.Code, § 6604.) The Act provides that the defendant "shall not be kept in actual custody longer than two years unless a subsequent extended commitment is obtained from the court incident to the filing of a petition for extended commitment...." (Welf. & Inst. Code, § 6604.)

B. Extended Commitment Procedures.

The Act is not particularly explicit regarding the procedures to be followed in connection with an extended commitment proceeding. The courts, however, have held that the procedures for an initial commitment also apply to an extended commitmentat least to the extent possible. (People v. Superior Court (Gary) (2000) 85 Cal.App.4th 207, 214, 101 Cal.Rptr.2d 874; Peters v. Superior Court (2000) 79 Cal. App.4th 845, 849, 94 Cal.Rptr.2d 350; Butler v. Superior Court (2000) 78 Cal.App.4th 1171, 1180-1181, 93 Cal.Rptr.2d 468.) Thus, in an extended commitment proceeding, the defendant is entitled to a probable cause hearing. (Cooley v. Superior Court (2001) 89 Cal.App.4th 785, 791-792, 107 Cal.Rptr.2d 724.) Also, the People may request a preliminary review of the petition for probable cause. (See Welf. & InstCode, § 6601.5.) The term of an extended commitment is two years from the end of the previous commitment. (Welf. & Inst.Code, § 6604.1, subd. (a).)
In 2000, the Legislature amended Welfare and Institutions Code section 6604.1, subdivision (b) so as to provide expressly that "[t]he rights, requirements, and procedures set forth in [Welfare and Institutions Code s]ection 6603 shall apply to extended commitment proceedings." (Stats.2000, ch. 420, § 4, p. 421.) This amendment, however, was not intended to change the existing law that all procedures for an initial commitmentnot just those set forth in Welfare and Institutions Code section 6603also apply to an extended commitment. (Cooley v. Superior Court, supra, 89 Cal.App.4th at pp. 787-792, 107 Cal.Rptr.2d 724.)

III-IV[***]

V

THE EXPIRATION OF DEFEDANT'S TERM PRIOR TO THE PROBABLE CAUSE HEARING
As already noted, defendant contends the trial court erred by refusing to dismiss the extended commitment petition, even *341 though his original commitment had expired and a probable cause hearing had not yet begun.
The Act explicitly requires that the defendant be in custody, pursuant to either a determinate prison term, a parole revocation term, or a 45-day evaluation hold, when the initial petition is filed. (Welf. & Inst.Code, § 6601, subd. (a)(2).) Because the procedures for an extended commitment parallel those for an initial commitment, we believe the Act equally requires that the defendant be in custody, pursuant to the prior commitment, when an extended commitment petition is filed.
The Act further provides that an initial petition cannot be dismissed based on a later determination that the defendant's custody was unlawful, provided the unlawful custody was the result of a good faith mistake. (Welf. & Inst.Code, § 6601, subd. (a)(2).) This necessarily implies that the petition should be dismissed if the unlawful custody was not the result of a good faith mistake. And, once again, we believe this requirement also applies to an extended commitment petition.
Here, however, when the extended commitment petition was filed, on August 18, 1999, defendant was in lawful custody. He therefore contends that the Act also requires that a defendant be in lawful custody (or, at least, in unlawful custody as the result of a good faith mistake) when the probable cause hearing begins.
The Act does not explicitly require this. Defendant infers such a requirement from "the structure of the . . . Act itself...." In particular, he points to the fact that the trial court must make a preliminary determination of probable cause before it can order the defendant kept in custody until the probable cause hearing and also the fact that the probable cause hearing must begin within 10 days after the trial court makes such a determination. (Welf. & InstCode, § 6601.5.) We would also note that, once the probable cause hearing does begin, the trial court must order the defendant kept in custody until the hearing is over. (Welf. & Inst.Code, § 6602, subd. (a).) Finally, if it finds probable cause, it must order the defendant kept in custody until the trial is over. (Ibid.)
This statutory scheme does indeed suggest that the Legislature intended the defendant to be in custody, not only when the petition is filed, but at every subsequent step in the process. But why? In other contexts, a person who is not in custody can be involuntarily committed. Indeed, often the very point of an involuntary commitment (or a similar involuntary detention) is to move a person off the streets and into protective custody. (See Welf. & Inst.Code, §§ 300 et seq.; 5150 et seq.; 6500 et seq.)
The evident reason here is to protect the publicto ensure that an alleged violent sexual predator is not loosed upon the world. (See People v. Kirkland (1994) 24 Cal.App.4th 891, 913, 29 Cal.Rptr.2d 863 [mentally disordered prisoners]; People v. Curtis (1986) 177 Cal.App.3d 982, 989, 223 Cal.Rptr. 397 [mentally disordered sex offenders].) When the Act was first passed, the Legislature declared: "These persons are not safe to be at large and if released represent a danger to the health and safety of others.... [I]t is in the interest of society to identify these individuals prior to the expiration of their terms of imprisonment." (Stats.1995, ch. 763, § 1, p. 4611.)[1] In 1999, the Legislature *342 amended the Act so as to expressly require that the defendant be in custody when the petition is filed. (Stats.1999, ch. 136, § 1.) However, it added that this amendment was declarative of existing law. (Stats.1999, ch. 136, § 3.) The legislative history explained: "The purpose behind requiring that a SVP petition be filed while an inmate is in custody is twofold: public protection and ensuring treatment to the dangerous mentally ill...." (Assem. Com. on Public Safety, Analysis of Sen. Bill No. 11 (1999-2000 Reg. Sess.) as amended Apr. 6, 1999, p. 4.)[2]
At the same time, the Legislature placed conditions on any pretrial extension of a defendant's custody, including successive findings of probable cause. Obviously, it did so to protect defendants. This ensures that they cannot be kept in custody beyond their release dates without some showing of good cause.
Here, defendant was kept in custody beyond his release date without any prior showing of good cause. Defendant concludes that he was entitled to be released. During the three days that he was unlawfully confined, however, he did not file a habeas corpus petition or otherwise seek release. The first time he turned to the trial court for help was on October 5, when he moved to dismiss the petition. Rather than dismiss, the trial court compliedalbeit belatedlywith Welfare and Institutions Code section 6601.5; it made a preliminary determination of probable cause, and it ordered defendant detained pending the probable cause hearing.
"Traditionally, the question of whether a public official's failure to comply with a statutory procedure should have the effect of invalidating a subsequent governmental action has been characterized as a question of whether the statute should be accorded `mandatory' or `directory' effect. If the failure is determined to have an invalidating effect, the statute is said to be mandatory; if the failure is determined not to invalidate subsequent action, the statute is said to be directory.... [I]n evaluating whether a provision is to be accorded mandatory or directory effect, courts look to the purpose of the procedural requirement to determine whether invalidation is necessary to promote the statutory design." (People v. McGee (1977) 19 Cal.3d 948, 958, 140 Cal.Rptr. 657, 568 P.2d 382.)
In light of the Legislature's evident purposes, we do not believe it intended an alleged sexually violent predator to be released solely because the trial court fails to make a finding of probable cause before the defendant's term expires. Here, the trial court did make the requisite preliminary probable cause finding, albeit three days too late. Defendant cannot claim he was prejudiced by the three-day delay. It is clear beyond a reasonable doubt that, if the trial court had reviewed the petition on October 2 instead of October 5, it would still have made the same preliminary probable cause finding. Thus, defendant would still have remained in custody beyond his release date. In sum the trial court properly accommodated the Legislature's concern that a defendant not be kept in custody beyond his or her release date without a showing of good cause; at the same time, it also properly accommodated the Legislature's concern that potentially dangerous sexually violent predators not be released.
We conclude that, under the circumstances, the trial court correctly refused to dismiss the petition or to release defendant.


*343 VI

DISPOSITION
The order appealed from is affirmed.
We concur: McKINSTER, Acting P.J., and WARD, J.
NOTES
[*]   Pursuant to California Rules of Court, rules 976(b) and 976.1, this opinion is certified for publication with the exception of parts III and IV.
[**]   Kennard, J., Chin, J., and Brown, J., dissented.
[***]   See footnote *, ante.
[1]  Available at Historical and Statutory Notes, 73D West's Ann. Welf. & Inst.Code (1998 ed.) foll. § 6600, pp. 249-250.
[2]  Available at  (as of Feb. 5, 2002).
