Petitioner, mother of A.S. and J.S., brings this appeal from the denial of her petition for habeas corpus to obtain custody of her minor children. In her petition, she asserted that the Vermont Department of Social and Rehabilitation Services (SRS) holds custody of A.S. and J.S. unlawfully because there never has been a valid juvenile court disposition order. She appeals from the denial of the petition in the superior court raising five points in her brief. All- but one of these points relate to the invalidity of the juvenile court disposition order. Her last attacks our juvenile laws as unconstitutional to the extent they allow the state to take custody of a child away from a parent. We reject these claims and affirm, albeit on different grounds from those relied upon by the superior court.
The state received A.S. and J.S. into custody on September 22, 1984, when petitioner abandoned both boys, and their siblings, in the aftermath of a violent domestic quarrel with a man with whom she had been living. On September 24, a temporary detention hearing was held and custody was continued with SRS. At the merits hearing on June 3, 1985, all parties stipulated that A.S. and J.S. were children in need of care and supervision pursuant to 33 V.S.A. § 654(a). The disposition hearing was then scheduled for and held on July 2, 1985. Since that disposition hearing, A.S. and J.S. have remained in foster care under the aegis of SRS. No written disposition order was ever entered. The action actually taken at the disposition hearing was disputed, as discussed below.
On December 1, 1987, appellant filed a petition for habeas corpus in the Caledonia Superior Court, claiming that the SRS custody of A.S. and J.S. was unlawful because the disposition hearing mandated by 33 V.S.A. § 656 had never been held, as shown by the fact that no written order was ever filed by the juvenile court. The case was first heard on December 17, 1987. The evidence at that time showed that there was no *489disposition order in the juvenile case but there had been a disposition hearing. It further showed that the clerk was looking for a disposition order on the theory that it might have been misfiled and that the SRS attorney had ordered a transcript of the disposition hearing. Petitioner testified that she wanted custody of A.S. and J.S., then ages nine and seven respectively, and was capable of caring for them. The court found evidence offered by SRS on the best interests of the children to be irrelevant and also excluded the results of reviews of custody status that had occurred since 1985. The court indicated that it would grant the petition on the following Monday and give SRS an opportunity to take whatever action was appropriate in the interim.
The case was again heard the following day. At that point, the parties had a transcript of the July 2, 1985, disposition hearing. That transcript showed that the parties had reached a stipulation in principle on a disposition order and the stipulation was accepted by the juvenile court. The court directed that a written stipulation be prepared and that an order be drafted based on the stipulation. The written stipulation was prepared and was signed by some of the parties but not by others. It was not signed by petitioner or her attorney. There was no evidence showing why the stipulation was not signed by all parties and why no order was drafted and submitted to the court. A social worker testified that SRS had followed the terms of the stipulation.
Based on the above evidence, the superior court rendered a new decision orally and on the record:
It’s the conclusion of the Court that the disposition hearing was held, that an agreement was reached in it, that Plaintiff here today was party to that agreement, that the Court accepted the agreement and directed that an order be drafted to carry it out.
So we have a hearing, we have an agreement, we have a direction to reduce the agreement to paper, we have the implementation of the agreement consistent with the Court’s intent; and the Court thinks that the spirit and meaning of the statute has been carried out, and that there is no just grounds for the granting of the petition for the writ of habeas corpus.
*490The underlying premise of most of petitioner’s claims is that she is entitled to the return of custody of A.S. and J.S. as relief in the habeas corpus action if there was a defect in the juvenile court order, or in the absence of a formal order. Thus, she argues that: (1) 33 V.S.A. § 634(a)’s requirement that a disposition order be “made and filed” can not be met by an oral order; (2) contrary to the superior court’s finding, there was no agreement to a disposition order and therefore any disposition order premised on an agreement was invalid; (3) there has been no juvenile court finding of parental unfitness as required for an order that transfers custody from a parent to SRS; and (4) the oral disposition order found by the superior court was too vague to be valid and enforceable. Even if we were to accept all these claims as valid, we do not believe they would, without more, entitle petitioner to habeas corpus relief.
The use of the writ of habeas corpus to determine the custody of a minor child, rather than the legality of a restraint on the liberty of the petitioner, is based on the common law and not on our habeas corpus statutes. See In re M. & G., 132 Vt. 410, 412, 321 A.2d 19, 21 (1974); In re Cooke, 114 Vt. 177, 183, 41 A.2d 177, 180 (1945). In the exercise of this jurisdiction, “the court acts as parens patriae” and “is guided solely by what it finds to be for the best interests of the infant under the circumstances” of the case. In re Cooke, 114 Vt. at 183, 41 A.2d at 180. See also In re Forslund, 123 Vt. 341, 343, 189 A.2d 537, 539 (1963) (court is guided by “best interests of the child”).
Our precedents are consistent with those from other courts that have addressed similar claims. Justice Blackmun in his dissent in Lehman v. Lycoming County Children’s Services Agency, 458 U.S. 502, 516-26 (1982), which denied federal habeas corpus jurisdiction in child custody cases, described the nature of the habeas corpus remedy. Id. at 516-17, 524-26. He noted that “courts have exercised broad discretion in deciding whether or not to invoke that power in a given case,” id. at 517 (emphasis in original), and went on to describe the nature of the discretion:
American common-law courts, however, soon relied [upon the English precedent of] King v. Delaval to resolve custody disputes initiated by way of a habeas writ in a *491manner best adapted to serve the welfare of the child____ Thus, the American common-law rule came to be that “the parent stands in court as the real party in interest ... but he is liable to be defeated by his own wrongdoing or unfitness and by the demands and requirements of society that the well-being of the child shall be deemed paramount to the natural rights of an unworthy parent.”
Id. at 524 (quoting Hand, Habeas Corpus Proceedings for the Release of Infants, 56 Cent. L. J. 385, 389 (1903)) (other citations omitted). See also McGaffin v. Roberts, 193 Conn. 393, 403, 479 A.2d 176, 182 (1984) (habeas corpus in custody cases is an equitable remedy where issue is not illegality of confinement but instead what is best for the child), cert. denied, 470 U.S. 1050 (1985); R.D.N. v. T.N., 218 Neb. 830, 835, 359 N.W.2d 777, 780 (1984) (in habeas corpus involving custody of children “the welfare and best interests of the child surpass considerations of strictly legal rights”); Lemley v. Barr, 343 S.E.2d 101, 104, 108-10 (W. Va. 1986) (court must determine the best interests of the child in habeas corpus case).*
The habeas corpus petition in this case alleges the defects in the juvenile court’s action or inaction as set out above and concludes that because SRS is holding A.S. and J.S. “without due process of law,” petitioner is entitled to “custody and control immediately.” There is no allegation that a return of custody to petitioner would be in the best interests of the children nor did V.A. seek to prove that at the superior court hearing on the petition. The absence of any pleading or proof in this issue is fatal to the grant of the petition.
*492In seeking to avoid this result, petitioner relies on In re B.M.L., 137 Vt. 396, 406 A.2d 383 (1979), a case where this Court held that the superior court has jurisdiction to grant a writ of habeas corpus on finding that a juvenile’s restraint was unlawful. In B.M.L., the juvenile was placed in state custody under a temporary detention order, and the juvenile court held a merits hearing. When no merits decision was issued after ten weeks from the hearing, the parent brought a habeas corpus action in superior court. This Court held that if the superior court determined that an unreasonable time elapsed after the merits hearing without an order, it must issue the writ of habeas corpus.
To the extent B.M.L. holds that the superior court must grant relief of a finding of unlawful restraint, it is inconsistent with In re Forslund and In re Cooke, and cannot stand. Thus, we overrule that part of B.M.L. that required the issuance of the writ solely on a finding of unreasonable delay in making merits findings without consideration of the best interest of the child. Henceforth, B.M.L. should be read as defining the unlawful restraint that will enable the superior court to grant habeas corpus relief if it finds that to do so would be in the best interest of the child.
We also do not believe that the holding of B.M.L. warrants relief in this case. Habeas corpus is not available as a means of collateral attack based on any error in a juvenile proceeding. In order for habeas corpus to lie, the procedural defect in the juvenile proceeding must be “jurisdictional” such that any order is void. See In re M. & G., 132 Vt. at 413, 321 A.2d at 21. We do not believe that the defects petitioner complains of in this case can be fairly termed jurisdictional.
In B.M.L. there had been no adjudication that the juvenile was in need of care and supervision. It is this merits determination that allows the juvenile court to go forward and make dispositional orders in the interest of the child. Here, there was a CHINS determination and a timely disposition hearing. The transcript indicates that the parties believed that they had reached agreement on a disposition order. The court indicated that it accepted the stipulation and would sign a written order based on it. If petitioner had thereafter decided that she could not agree to the stipulation, she could have *493returned to the juvenile court for relief, including a full disposition hearing if the court found the stipulation was not binding on her. When she realized there was no signed stipulation and written order, she was free to return to juvenile court for the same kind of relief. We believe it would be inappropriate to allow petitioner to sleep on her rights for two and one-half years and then gain custody of her children through habeas corpus without going back to the juvenile court.
We are persuaded by the reasoning of the California Supreme Court in Adoption of Alexander S., 44 Cal. 3d 857, 750 P.2d 778, 245 Cal. Rptr. 1 (1988), which held that habeas corpus was not available to a natural mother to collaterally attack a judgment of adoption of her child as long as the court has jurisdiction to render the judgment. Id. at 867-68, 750 P.2d at 785, 245 Cal. Rptr. at 7. Justice Panelli, speaking for the court, adopted this view in large part because, as he said, “[pjrotracted litigation over the custody of a child may harm the child” and because the interest in finality is unusually strong in child custody cases due to the need for “secure, stable, long-term, continuous relationships with their parents or foster parents.” Id. at 868, 750 P.2d at 785, 245 Cal. Rptr. at 7. We are unwilling to open the door for collateral attack any wider than the circumstances of B.M.L. Petitioner presented insufficient grounds to allow collateral attack in this case.
Finally, petitioner makes a broadside and unfocused constitutional attack on our juvenile laws, asserting that they create involuntary servitude and deny due process of law. We find the statutes that allow the juvenile court to place custody of children with SRS or persons other than the parents to be constitutional. See In re R.B., 152 Vt. 415, 426, 566 A.2d 1310, 1316 (1989).
Affirmed.
Petitioner relies on Roussel v. State, 274 A.2d 909 (Me. 1971), for the proposition that the only issue before the Court is the legality of the custody of the juvenile involved in the proceeding. Roussel contains an extensive historic analysis of the use of habeas corpus in child custody cases and the independent equity action to control custody of a child. The Maine court concludes that these independent actions have been merged once the trial courts obtained in Maine concurrent law and equity powers. The consideration of the interests of the child comes from the equity action and is part of the court’s adjudication under Roussel. Thus, Roussel does not stand for the proposition that the only issue in a child custody habeas corpus proceeding is the legality of custody. It’s holding on the issues to be adjudicated in child custody habeas corpus cases supports our conclusion in this case.