
221 Wis.2d 401 (1998)
585 N.W.2d 637
IN RE the COMMITMENT OF Larry J. SPROSTY:
STATE of Wisconsin, Petitioner-Respondent,[]
v.
Larry J. SPROSTY, Respondent-Appellant.
No. 97-3524.
Court of Appeals of Wisconsin.
Submitted on briefs June 9, 1998.
Decided August 6, 1998.
*402 On behalf of the defendant-appellant, the cause was submitted on the briefs of T. Christopher Kelly of Thomas, Kelly, Habermehl & Wood, S.C. of Madison.
On behalf of the petitioner-respondent, the cause was submitted on the brief of James E. Doyle, attorney general, and Warren D. Weinstein, assistant attorney general.
Before Dykman, P.J., Vergeront and Deininger, JJ.
DYKMAN, P.J.
Larry J. Sprosty appeals from an order denying his supervised release under Chapter 980, STATS. Sprosty argues that the committing court erred when it ordered his continued confinement after *403 it had approved his supervised release. We conclude that § 980.08(5), STATS., requires that a person be released if the trial court determines that supervised release is appropriate, regardless of whether the Department of Health and Family Services (DHFS) locates an appropriate treatment facility willing to accept the person. We therefore reverse and remand with directions.

BACKGROUND
In 1995, Larry J. Sprosty was committed as a sexual predator under Chapter 980, STATS. On February 1, 1996, Sprosty filed a motion for supervised release. At his evidentiary hearing, experts testified that although Sprosty needed to continue his participation in sex offender and substance abuse treatment, he could do so while living in the community under close supervision. The trial court agreed and granted the petition for supervised release. In the written order, the trial court stated that the Department of Corrections through the Wisconsin Resource Center should be notified of this order and that the Department of Probation and Parole of the county of residence or intended residence of Sprosty shall prepare a plan identifying the treatment and services that he would receive in the community. In the meantime, the court ordered that Sprosty remain in custody until further order of the court.
Heather Leach, a social worker for the Wisconsin Resource Center (WRC), corresponded with the trial court regarding the treatment and services that Sprosty required. She stated that the WRC clinical staff believed that an adequate and appropriate treatment and service plan would include halfway house placement followed by placement in the community on electronic monitoring, intensive and long-term sex *404 offender treatment with a qualified experienced provider, alcohol and substance abuse treatment, and high risk supervision by a Sex Offender Intensive Supervision Program (SO-ISP) Agent. Leach indicated that she was having difficulty locating a county in which a half-way house, sex offender treatment, and sex offender supervision were all available. She stated that Crawford County, which was Sprosty's county of residence, lacked all of these resources. Leach did locate four counties, Dane, Milwaukee, La Crossed and Portage, that had sex offender treatment, SO-ISP supervision, and at least one halfway house; however, several of these facilities refused to admit Sprosty into their programs.
On April 11, 1997, the court held a status conference. The court agreed that Crawford County should be ordered to prepare a plan. On May 29, 1997, the court entered a formal order to that effect.
In June 1997, two hearings were held regarding the preparation of Sprosty's community treatment plan. At these hearings, the Crawford County district attorney stated that its experts were unable to develop an appropriate plan for Sprosty's supervised release. Specifically, he stated that Crawford County did not have the resources to address Sprosty's various treatment needs in a community setting. After listening to the county's report, the court stated the following:
Last September 27th this Court made a finding that Mr. Sprosty could be released on supervised release in the community, provided that certain conditions necessary for the safety of the community and for his treatment and supervision could be developed or satisfied and the Court requested that state and county to prepare a plan. That plan has been presented and supplemented. Basically the plan *405 indicates that what is necessary to accommodate the needs for treatment for supervision and for protection of the community are unavailable at this time, not only in Crawford County but elsewhere. The Court can not compel private agencies to accept Mr. Sprosty and the State attempted to make contact with some private agencies who would not accept Mr. Sprosty into their halfway house or treatment program. The Court will not require the State to build facilities in order to provide supervised release for Mr. Sprosty and the Court will not release Mr. Sprosty under conditions that are less than necessary to insure Mr. Sprosty's treatment and protection of the public and supervision of Mr. Sprosty.
Thereafter, the trial court entered an order denying Sprosty's supervised release and returned him to secured confinement. Sprosty appeals.

DISCUSSION
[1]
Sprosty argues that once the court determined that his release was appropriate, it had no authority under § 980.08, STATS., to order his continued confinement simply because the state and county agencies could not locate an appropriate facility willing to accept him. Whether a court properly interpreted and applied the law in ordering a patient's continued confinement under Chapter 980 presents a question of law that we review de novo. State v. Keding, 214 Wis. 2d 362, 366, 571 N.W.2d 450, 452 (Ct. App. 1997).
[2, 3]
Whether § 980.08(5), STATS., allows a court to order a person's continued confinement after it has determined that supervised release is appropriate presents a question of statutory interpretation. The *406 goal of statutory interpretation is to ascertain the intent of the legislature. MCI Telecomm. Corp. v. State, 203 Wis. 2d 392, 400, 553 N.W.2d 284, 287 (Ct. App. 1996), aff'd, 209 Wis. 2d 310, 562 N.W.2d 594 (1997). Our first inquiry is to the language of the statute. Id. If the meaning is clear and unambiguous, our inquiry ends and we apply the language of the statute to facts of the case. Id. at 400, 553 N.W.2d at 288. But, if the language is ambiguous, we may examine the scope, history, context, subject matter and purpose of the statute. Id.
Section 980.08, STATS., deals with the supervised release of persons committed under the sexual offender program. Section 980.08(1) permits any person committed for institutional care in a secure facility to petition the committing court for supervised release. Section 980.08(3) sets out an examination procedure in which court-appointed specialists examine the person to determine whether supervised release is appropriate. Section 980.08(4) states that within thirty days after the examination reports are filed, the court shall hear the petition. The court shall grant the petition "unless the state proves by clear and convincing evidence that the person is still a sexually violent person and that it is still substantially probable that the person will engage in acts of sexual violence if the person is not confined in a secure mental health unit or facility." Section 980.08(4). The court has a great deal of discretion in making this determination.
The disputed statutory provision in this case is § 980.08(5), STATS. This subsection deals with the procedures that are to be followed after a committing court has determined that supervised release is appropriate. Section 980.08(5) reads, in pertinent part, as follows:

*407 If the court finds that the person is appropriate for supervised release, the court shall notify the [DHFS]. [DHFS] and the county [social services agency] in the county of residence of the person . . . shall prepare a plan that identifies the treatment and services, if any, that the person will receive in the community. The plan shall address the person's need, if any, for supervision, counseling, medication, community support services, residential services, vocational services, and alcohol or other drug abuse treatment. The department may contract with a county department, . . . with another public agency or with a private agency to provide the treatment and services identified in the plan. The plan shall specify who will be responsible for providing the treatment and services identified in the plan. The plan shall be presented to the court for its approval within 60 days after the court finding that the person is appropriate for supervised release, unless the department, county department and person to be released request additional time to develop the plan. If the county department of the person's county of residence declines to prepare a plan, the department may arrange for another county to prepare the plan if that county agrees to prepare the plan and if the person will be living in that county. If the department is unable to arrange for another county to prepare a plan, the court shall designate a county department to prepare the plan, order the county department to prepare the plan and place the person on supervised release in that county. . .

(Emphasis added.)
We conclude that § 980.08(5), STATS., requires a person's release once the court has determined that *408 release is appropriate.[1] After it determines supervised release to be appropriate, the court must notify DHFS. DHFS then contacts the social services agency in the county in which the person resides, and together they must prepare a plan that identifies the treatment and services that the person is to receive in the community. After the plan is prepared, DHFS may then contract with the county social services agency, another public agency, or a private agency to provide the treatment and services identified in the plan. However, if the social services agency in the person's county of residence declines to prepare a plan, DHFS may then arrange with another county to prepare the plan if the person will be living in that county. If DHFS is unable to find another county willing to prepare the plan, the court must then designate a county social services agency to prepare the plan, order it to prepare the plan, and place the person on supervised release in that county. In the end, the court and the DHFS are responsible for making sure that an appropriate treatment plan is developed and that the person is placed on supervised release in a community.
In this case, the court ordered Crawford County to prepare a plan, and Crawford County declined to develop a plan, because it did not have the appropriate resources to treat Sprosty's various needs. Several private facilities in other counties that could provide the necessary treatment and services declined to do so. As a result, the court apparently decided that there were no other options available, and it ordered that Sprosty remain confined in a secured facility.
*409 [4]
We conclude that the unambiguous statutory language did not permit the court to order continued confinement. Section 980.08(5), STATS., requires that if the person's county of residence is unable or unwilling to prepare a plan, and no other counties agree to prepare a plan or accept the person into their program, the committing court must designate a county for placement. There is no exception within § 980.08(5), which states that a court can refuse to order release after it has determined that release is appropriate. If necessary treatment programs and facilities are currently unavailable, as apparently was the situation in this case, the county designated by the court carries the burden of creating or contracting for the necessary programs and facilities. Therefore, we conclude that Crawford County, which apparently was the county designated by the court at the April 11 hearing to prepare a plan and arrange for Sprosty's placement, or another county which the court may designate on remand, has the burden of creating the programs that are required for Sprosty's treatment and supervision. Accordingly, we reverse and remand with directions to order a county to do what is necessary for Sprosty's release.
By the Court.Order reversed and cause remanded with directions.
NOTES
[]  Petition to review granted.
[1]  The word "shall" is given mandatory meaning when it is used in a statute. Karow v. Milwaukee County Civil Serv. Comm'n, 82 Wis. 2d 565, 570, 263 N.W.2d 214, 217 (1978).
