The respondent is appealing from the order of the trial court terminating her parental rights. The respondent claims that the trial court erred (1) in denying her motion to dismiss the petition for lack of subject matter jurisdiction, and (2) in terminating her parental rights without first finding that the grounds for termination had existed for more than one year before the filing of the termination petition.
On February 2,1984, the respondent’s child, with the voluntary assent of the respondent, was adjudicated uncared for and was committed to the commissioner of the department of children and youth services (DCYS or commissioner) for the statutory maximum of eighteen months. On May 28,1985, sixty-seven days before the expiration of the eighteen month commitment, the commissioner filed a petition to terminate the respondent’s parental rights. The petition alleged three statutory grounds for termination1 and further alleged that *508the grounds had existed not less than one year. On June 25, 1985, at a plea hearing, the respondent entered a denial to the allegations of the petition and agreed with the commissioner to an extension of the child’s commitment.
On September 17, 1985, the day the trial was to begin, the respondent filed a motion to dismiss the termination petition. The respondent alleged that the court lacked subject matter jurisdiction because the commissioner had filed the petition only sixty-seven days before the expiration of the child’s commitment, whereas General Statutes § 46b-129 (e)2 requires that such petition “shall” be filed ninety days before the expiration of such commitment.
The trial court denied the motion to dismiss, and extended, suo motu, the child’s commitment. After a full trial, the court, on November 27, 1985, rendered judgment terminating the respondent’s parental rights. The court based its decision on two statutory grounds: *509(1) that the respondent had failed to achieve such degree of personal rehabilitation as would encourage the belief that within a reasonable time, considering the age and needs of the child, she could assume a responsible position in the life of the child; General Statutes § 17-43a (b) (2); and (2) that there was no ongoing parent-child relationship, and to allow further time for the establishment or reestablishment of such parent-child relationship would be detrimental to the best interests of the child. General Statutes § 17-43a (b) (4). From this judgment, the respondent appeals.
The respondent’s first claim is that the trial court erred in denying her motion to dismiss the commissioner’s termination petition because the petition was not filed ninety days before the termination of the child’s commitment as prescribed by General Statutes § 46b-129 (e). We disagree.
General Statutes § 46b-129 governs petitions for adjudication of neglected children and the appropriate “commitment” of their custody. Section 46b-129 (e) requires that ninety days before the expiration of each eighteen month commitment made in accordance with § 46b-129 (d), the commissioner “shall” petition the Superior Court either (1) to revoke the commitment, (2) to terminate the parental rights, or (3) to extend the commitment an additional period. Our concern is whether the use of the word “shall” in this section makes the ninety day filing period mandatory or directory. If the term “shall” is directory rather than mandatory, the failure of the commissioner to file the petition within ninety days of the expiration of the commitment would not deprive the court of jurisdiction over this proceeding. See Winslow v. Zoning Board, 143 Conn. 381, 387-88, 122 A.2d 789 (1956).
Although the word “shall” is generally determined to be mandatory; Graham v. Zimmerman, 181 Conn. *510367, 371, 435 A.2d 996 (1980); Shulman v. Zoning Board of Appeals, 154 Conn. 426, 428-29, 226 A.2d 380 (1967); our Supreme Court has consistently shown “a disposition to look through the literal meaning of words and forms of procedure to the essential purposes to be served.” Tramontano v. Dilieto, 192 Conn. 426, 433, 472 A.2d 768 (1984), quoting Conners v. New Haven, 101 Conn. 191, 198, 125 A. 375 (1924). This consistency has been manifest since the early decisions of the court in this state. Conners v. New Haven, supra; State ex rel. Rylands v. Pinkerman, 63 Conn. 176, 197, 28 A. 110 (1893); Baldwin v. North Branford, 32 Conn. 47, 54-55 (1864); Bartlett v. Kinsley, 15 Conn. 327, 332-33 (1843); West School District of Canton v. Merrills, 12 Conn. 437, 438-39 (1838); Todd v. Hall, 10 Conn. 544, 557-58 (1835). The use of the word “shall,” though significant, does not invariably create a mandatory duty because statutes must be viewed as a whole to ascertain the legislative intention. Tramontano v. Dilieto, supra; State ex rel. Arcudi v. Iassogna, 165 Conn. 203, 204-205, 332 A.2d 90 (1973).
“The test to be applied in determining whether a statute is mandatory or directory is whether the prescribed mode of action is the essence of the thing to be accomplished, or in other words, whether it relates to a matter of substance or a matter of convenience. International Brotherhood of Teamsters v. Shapiro, 138 Conn. 57, 68, 82 A.2d 345 (1951). If it is a matter of substance, the statutory provision is mandatory. State ex rel. Eastern Color Printing Co. v. Jenks, 150 Conn. 444, 451, 190 A.2d 591 (1963). If, however, the legislative provision is designed to secure order, system and dispatch in the proceedings, it is generally held to be directory, especially where the requirement is stated in affirmative terms unaccompanied by negative words. Winslow v. Zoning Board, [supra, 388], ‘Such a statutory provision is one which prescribes what shall be *511done but does not invalidate action upon a failure to comply.’ Broadriver, Inc. v. Stamford, 158 Conn. 522, 529, 265 A.2d 75 (1969).” Fidelity Trust Co. v. BVD Associates, 196 Conn. 270, 278, 492 A.2d 180 (1985).
In this case, the ninety day time frame in General Statutes § 46b-129 (e) was enacted as part of a revision of this statute by No. 579 of the 1979 Public Acts. Prior to this revision, children committed by the court to DCYS were often placed in foster care for indeterminate and lengthy periods without further judicial review. In re Juvenile Appeal (85-BC), 195 Conn. 344, 358, 488 A.2d 790 (1985) (discussing legislative history). The 1979 act, however, established a two year maximum time limit for the period of commitment to custody, which limit was subsequently reduced to eighteen months by No. 181 of the 1982 Public Acts. In re Juvenile Appeal (85-BC), supra, 358; see General Statutes § 46b-129 (d). The 1979 act also required DCYS to either revoke the commitment, terminate the parental rights, or seek an extension of the commitment “ninety days before the expiration” of the commitment. General Statutes § 46b-129 (e). “The legislative concerns underlying the establishment of the time limits of § 46b-129 (d) and (e) are thus unambiguous: to establish a durational limitation on the frequently lengthy placement of children in foster homes or other institutions while committed to DCYS so as to require periodic judicial review of their cases.” In re Juvenile Appeal (85-BC), supra, 361. These time restrictions on commitment, in turn, encourage the formation of a permanent plan for the child, which is generally agreed to be consistent with the best interests of children in temporary foster care.
Although it is clear that the legislature intended to place time limitations on DCYS actions when it amended General Statutes § 46b-129, it is equally clear that the time restriction that was of the greatest con*512cern was the two year (now eighteen month) commitment restriction in § 46b-129 (d) rather than the ninety day petition deadline in § 46b-129 (e). The two year limit fixed the duration of DCYS commitments, while the ninety day deadline merely sought to enforce that limit by requiring DCYS to initiate judicial action and provide notice to the relevant parties at a reasonable period before the expiration of the commitment. The two year deadline was the focus of the legislative discussion; In re Juvenile Appeal (85-BC), supra, 358¢P61; while little mention was made of the ninety day deadline. The ninety day deadline therefore appears to be “designed to secure order, system and dispatch in the proceedings” and is thus directory rather than mandatory in these proceedings. Fidelity Trust Co. v. BVD Associates, supra, 278. In addition, as in other statutory provisions that have been determined to be directory, the requirement here prescribes what is to be done without invalidating an action or otherwise providing a penalty upon a failure to comply. Id. Furthermore, we are not unmindful that a mandatory construction of § 46b-129 (e) could result in the undesirable termination of a commitment and the return of a child to what could be a hostile, unsafe and dangerous environment. Such an action would certainly not be in the best interest of the child. See General Statutes §§ 17-43a, 46b-129 (e); In re Juvenile Appeal (88-CD), 189 Conn. 276, 285, 455 A.2d 1313 (1983). We find no error in the trial court’s definition of “shall” as directory rather than mandatory in the context of General Statutes § 46b-129 (e).
Because we concur with the decision of the trial court that “shall” as used in 46b-129 (e) is directory rather than mandatory, we agree that the trial court had subject matter jurisdiction over these proceedings; see Winslow v. Zoning Board, supra, 387¢88; and that by failing to object in a timely manner to the filing of the *513petition the respondent waived her right to do so. The petition was filed on May 28, 1985. The respondent appeared with counsel on June 25,1985, but the respondent did not file her motion to dismiss the petition until September 17,1985, eighty-four days later. The respondent, therefore, failed to comply with the thirty day requirement for filing a motion to dismiss. Practice Book § 142.3 The court did not err in concluding that the respondent waived her right to contest the jurisdiction of the court.
The respondent’s second claim of error, that the court failed to find that the grounds for termination of parental rights had existed for at least one year, is contradicted by the record. The trial court in its termination order4 expressly found that the grounds for termination of parental rights had existed for not less than one year.
There is no error.
In this opinion the other judges concurred.
The petition relied on the grounds set forth in General Statutes § 17-43a (b) (2), (3) and (4). General Statutes § 17-43a (b) provides in pertinent part:
“The superior court upon hearing and notice, as provided in sections 45-61d and 45-61f, may grant such petition if it finds, upon clear and convincing evidence, that the termination is in the best interest of the child and that, with respect to any consenting parent, such parent has voluntarily and knowingly consented to termination of his parental rights with respect to such child or that, with respect to any nonconsenting parent, over an extended period of time, which, except as provided in subsection (c) of this section, shall not be less than one year: (1) The child has been abandoned by the parent in the sense that the parent has failed to maintain a reasonable degree of interest, concern or responsibility as to the welfare of the child; or (2) the parents of a child who has been found by the superior court to have been neglected or uncared for in a prior proceeding have failed to achieve such degree of personal rehabilitation as would encourage the belief that within a reasonable time, considering the age and needs of the child, they could assume a responsible position in the life of the child; *508or (3) the child has been denied, by reason of an act or acts of parental commission or omission, the care, guidance or control necessary for his physical, educational, moral or emotional well-being. Nonaccidental or inadequately explained serious physical injury to a child shall constitute prima facie evidence of acts of parental commission or omission sufficient for the termination of parental rights; or (4) there is no ongoing parent-child relationship, which means the relationship that ordinarily develops as a result of a parent having met on a day to day basis the physical, emotional, moral and educational needs of the child and to allow further time for the establishment or reestablishment of such parent-child relationship would be detrimental to the best interest of the child.”
General Statutes § 46b-129 (e) provides in pertinent part:
“Ninety days before the expiration of each eighteen-month commitment made in accordance with the provisions of subsection (d) of this section and each extension made pursuant to the provisions of this subsection, the commissioner of children and youth services shall petition the court either to (1) revoke such commitment, in accordance with the provisions of subsection (g) of this section, or (2) terminate parental rights in accordance with the provisions of section 17-43a, or (3) extend the commitment beyond such eighteen-month period on the ground that an extension is in the best interest of the child.”
Practice Book § 142 provides in pertinent part: “Any defendant, wishing to contest the court’s jurisdiction, may do so even after having entered a general appearance, but must do so by filing a motion to dismiss within thirty days of the filing of an appearance.”
The trial court’s findings, as contained in its judgment entitled “Order Terminating Parental Rights and Appointing Statutory Parent,” were in pertinent part: “That the parental rights in the said child should be terminated for the reason(s) that the court finds, upon clear and convincing proof, that the termination is in the best interests of the child and that over an extended, period of time of not less than one year . . . the child has been found by the Superior Court in a prior proceeding to have been uncared for and the mother has failed to achieve such degree of personal rehabilitation . . . [and] there exists between mother and child no ongoing parent-child relationship [as defined in General Statutes § 17-43a] . . . . ” (Emphasis added.)