The plaintiff, William Stevens (“Stevens”), was adjudicated a sexually dangerous person (“SDP”) on September 26, 2006 and has since been committed to the Massachusetts Treatment Center (“Treatment Center”). On December 17, 2008, Stevens initiated this action by filing his second petition for discharge from the Treatment Center pursuant to G.L.c. 123A, §9. In this §9 proceeding, Stevens has filed amotion to correct miscalculation of jail credits, petition for habeas corpus, and motion for preliminary and permanent injunctive relief, combined in one document (“petition for habeas corpus”). Stevens argues that he is entitled to immediate release from custody because at the time the Commonwealth filed its civil commitment petition, he was not a “prisoner” under G.L.c. 123A, § 12(b). For the following reasons, Stevens’s petition for habeas corpus is DENIED.
BACKGROUND
On June 4,1998, Stevens was arrested and charged with rape and abuse of a child, indecent assault and battery, and possession of obscene material. On June 12,1998, Stevens was indicted, and on June 18,1998, he was arraigned on the indictments charging him with rape of a child, unnatural acts, procuring alcohol for a minor, and disseminating obscene material. On September 1, 1999, Stevens pleaded guilty and was sentenced by the court to a sentence of six years to six years and one day at MCI-Cedar Junction, followed by three years of probation. As the docket reflects, when the sentence was imposed on September 1, 1999, Stevens was deemed to have served 453 days of the sentence; he received 453 days of jail credit for the time he spent in custody awaiting trial. Stevens had been held in custody since his arrest on June 4, 1998. The trial judge stayed execution of Stevens’s sentence until September 7, 1999. On September 1, 1999, the court revoked its prior bail order, and Stevens was held without bail during the period of the stay. The trial court did not credit Stevens with an additional 6 days for the period that his sentence was stayed from September 1 to September 7, 1999.
During the course of his incarceration, Stevens earned an additional 132 days of earned good time credits, pursuant to G.L.c. 127, §129D. The Department of Correction (“DOC”) records show that the DOC credited Stevens with 127 days of earned good time for the period from the date he began serving his sentence, September 7, 1998, through December 31, 2003. As evidenced by the handwritten notations on the DOC records, the DOC also gave Stevens 5 days credit for the month of January 2004 for his participation in work and education programs. The total earned good time credited to Stevens was therefore 132 days. In calculating Stevens’s sentence to determine his release date, the DOC first subtracted the 453 days of jail credit as determined by the court, which would have made Stevens’s release date June 11, 2004; and then subtracted 132 days of earned good time to arrive at a final release date of January 31, 2004. If the court had given Stevens 6 days of jail credit for the period that his sentence was stayed, his release date would have been January 25, 2004.
On January 30, 2004, the day before Stevens was due to be released from his sentence, the Commonwealth filed a petition to civilly commit Stevens as a sexually dangerous person under G.L.c. 123A, § 14(e). After a trial without a jury, on September 26, 2006, the court found Stevens to be a sexually dangerous person and committed him to the Treatment Center for one day to life. On October 3, 2006, Stevens filed a notice of appeal. Stevens appealed the court’s judgment finding him a sexually dangerous person to the Appeals Court, but on April 6, 2009, he voluntarily withdrew the appeal by filing a motion to dismiss the appeal with prejudice. His appeal was therefore dismissed.
While pursuing the appeal of his initial commitment, on January 2, 2007, Stevens filed a petition pursuant to G.L.c. 123A, §9, seeking discharge from the Treatment Center. A jury trial was held on Stevens’s petition for discharge, and on December 8, 2008, the jury returned a verdict that Stevens remained a sexually dangerous person. Stevens did not appeal the jury’s verdict.
On December 17, 2008, Stevens filed a second petition for discharge pursuant to G.L.c. 123A, §9, thus initiating this §9 action. On September 23, 2010, Stevens filed this petition for habeas corpus, titled “Petitioner’s Motion to Correct Miscalculation of Jail Credit, Petition for Habeas Corpus, and Motion for Preliminary and Permanent Injunctive Relief.”
• DISCUSSION
Despite its title, Stevens’s “Motion to Correct Miscalculation of Jail Credit, Petition for Habeas Corpus, and Motion for Preliminary and Permanent Injunctive Relief’ is essentially a petition for a writ of habeas corpus pursuant to G.L.c. 248, §1 and the Massachusetts Constitution, in which he seeks immediate release from confinement. In connection with his habeas corpus petition, Stevens also requests this court to correct the calculation of jail credits that was made when his sentence was imposed in September 2004 and to enjoin the District Attorney from Barnstable County from further prosecuting the initial petition filed on January 30, 2004 seeking Stevens’s commitment as a sexually dangerous person.
“Habeas corpus is the historical remedial process whenever it appears that one is deprived of his liberty without due process of law in violation of the Constitution of the United States.” O’Leary, Petitioner, 325 *322Mass. 179, 184 (1950). The Massachusetts Constitution provides: “The privilege and benefit of the writ of habeas corpus shall be enjoyed in this Commonwealth in the most free, easy, cheap, expeditious and ample manner: and shall not be suspended by the legislature, except upon the most urgent and pressing occasions, and for a limited time not exceeding twelve months.”- Part II, c.6, art. 7 of the Massachusetts Constitution. General Laws Chapter 248, Section 1, provides: “Whoever is imprisoned or restrained of his liberty may, as of right and of course, prosecute a writ of habeas corpus, according to this chapter, to obtain relief from such imprisonment or restraint, if it proves to be unlawful, . . .” G.L.c. 248, §1. “The writ may be issued, irrespective of the county in which the person is imprisoned or restrained, by the supreme judicial or the superior court. . .” G.L.c. 248, §2. To obtain a writ of habeas corpus, a petitioner must demonstrate an entitlement to immediate release. See Stokes v. Superintendent, Mass. Correctional Inst., Walpole, 389 Mass. 883, 886 (1983); Hennessy v. Superintendent Mass. Correctional Inst., Framingham, 386 Mass. 848, 852 (1982); Stearns, petitioner, 343 Mass. 53, 56-57 (1961).
In his petition for habeas corpus, Stevens argues that he is entitled to immediate release from his commitment as a sexually dangerous person because at the time the Commonwealth filed its initial petition seeking to commit him on January 30, 2004, he was not a “prisoner” within the meaning of G.L.c. 123, §12(b). Stevens asserts that he was in custody on January 30, 2004 as a result of a clerical error made by the sentencing court at the time his sentence was imposed in failing to credit him with 6 days1 of jail credit for the period that he was held in custody while his sentence was stayed. If Stevens had been credited with these 6 days of jail credit, his release date from the DOC would have been January 25, 2004, and he would not have been in custody on January 30, 2004 when the Commonwealth filed its petition.2 Because his criminal sentence should have expired prior to the commitment petition being filed, except for the court’s miscalculation of jail credits, Stevens argues that he was not a “prisoner” on January 30, 2004, and the court did not have jurisdiction to determine the commitment petition and order his commitment as a sexually dangerous person.
I. Proper Forum
The Commonwealth argues that Stevens’s petition for habeas corpus, which challenges the legality of his original commitment as a sexually dangerous person, must be dismissed because the scope of a G.L.c. 123A, §9 proceeding is strictly limited to the factual question of whether Stevens continues to be a sexually dangerous person. The Commonwealth is correct that “(p)roceedings under G.L.c. 123A, §9 are to ’’determine the single issue whether or not the petitioner is a sexually dangerous person" and that “in order to simplify and expedite hearings under G.L.c. 123A, §9, such hearings should be restricted to the sole issue for which they were intended.” Gagnon, petitioner, 416 Mass. 775, 778 (1994), quoting Davis, petitioner, 383 Mass. 645, 649-50 (1981). This session, the unified session of the superior court, was established in Suffolk County by the legislature to exclusively address the numerous §9 petitions for discharge filed by persons committed to the Treatment Center. The appropriate manner and forum for Stevens to file a petition for habeas corpus is by initiating a separate action in a civil session of the superior court, not in the unified session for §9 petitions.
This court, however, does have jurisdiction to decide Stevens’s petition for habeas corpus, and this court is mindful that the Massachusetts Constitution provides that “(t]he privilege and benefit of the writ of habeas corpus shall be enjoyed in this Commonwealth in the most free, easy, cheap, expeditious and ample manner.” Further, the issues raised by Stevens in his petition can also be decided separately from the trial on his §9 petition. Both Stevens and the Commonwealth have fully briefed the issues raised by Stevens’s petition for habeas corpus and this court has conducted a hearing. “It would be a reproach to the judicial system and would squander judicial and legal resources” to require Stevens to file a separate action seeking habeas corpus relief, especially where such relief should be free, easy, cheap, and expeditious. See Redgate, petitioner, 417 Mass. 799, 801 (1994). Having heard the arguments, which have been fully briefed, this court will decide Stevens’s petition for habeas corpus.
II. Post-Conviction Relief Pursuant to Mass.R.Crim.P. 30
The Commonwealth next argues that Stevens’s petition must be dismissed because his challenge to his initial commitment as a sexually dangerous person, which is grounded upon his argument that the trial judge miscalculated jail credits to his criminal sentence, must be brought as a motion before the trial judge pursuant to Mass.R.Crim.P. 30, and is not the proper subject of a petition for habeas corpus before this court. Rule 30(a) provides: “Any person who is imprisoned or whose liberty is restrained pursuant to a criminal conviction may at any time, as of right, file a written motion requesting the trial judge to release him or her or to correct the sentence then being served upon the ground that the confinement or restraint was imposed in violation of the Constitution of the United States or of the Commonwealth of Massachusetts.” Mass.R.Crim.P. 30(a). Contrary to the Commonwealth’s argument, Stevens is not restricted to Rule 30 post-conviction relief because he is not imprisoned and his liberty is not restrained “pursuant to a criminal conviction.” Stevens’s sentence for his criminal conviction expired in 2004. He is presently committed and deprived of his liberty because he was *323determined to be and remain a sexually dangerous person under G.L.c. 123A, not because of his criminal conviction. See G.L.c. 123A, §1; See Commonwealth v. Bruno, 432 Mass. 480, 409 (2000) (conduct triggering G.L.c. 123A’s application is not the prior conviction of a sexual offense, but the current mental condition of the defendant).
Additionally, although grounded in part on the calculation of jail credits to his sentence, Stevens’s petition is a challenge to the legality of his civil commitment based upon his assertion that he was not a “prisoner” within the meaning of G.L.c. 123A, § 12(b) at the time the Commonwealth filed its initial petition to commit him. While the issue of the calculation of jail credits relates to the criminal sentence imposed by the trial judge, the issue of whether he is entitled to immediate release from civil commitment because he was not a prisoner under the statute when the commitment petition was filed does not challenge the indictment, trial, conviction or sentence. The petition thus raises issues of which the trial judge is not familiar and is completely unaware. “(W]here a petition for habeas corpus is based on grounds distinct from the issues at the indictment, trial, conviction, or sentencing stage,” a writ of habeas corpus is the proper remedy to seek, and a petitioner should not be restricted to Rule 30 relief. See Averett, petitioner, 404 Mass. 28, 31-32 (1989) (“individuals who establish that their lawfully imposed sentences have expired may petition for habeas corpus relief and are not limited to [Mass.R.Crim.] 30 postconviction relief . . .”); Kenney v. Commissioner of Correction, 399 Mass. 137, 138 (1987) (forfeitures of good time credits do not challenge the indictment, trial, conviction or sentencing stage and therefore are not limited to Rule 30 postconviction relief).
Furthermore, the issue of whether the trial judge should have credited Stevens with an additional 6 days for the period that his sentence was stayed from September 1 to September 7, 1999 is not an issue which necessarily requires the familiarity of the trial judge. Determination of this issue involves limited facts and caselaw and can be addressed just as effectively by this court as by the trial judge. Accordingly, Stevens’s habeas corpus petition is proper and need not be brought before the trial judge pursuant to Rule 30.
III. Propriety of Habeas Corpus Proceeding Where Opportunity for Appeal
By his habeas corpus petition, Stevens challenges the legality of his initial commitment as a sexually dangerous person, which was ordered on September 26, 2006, on the ground that he was not a prisoner when the Commonwealth filed the initial petition seeking his commitment on January 30, 2004. It is settled, however, that “habeas corpus cannot be employed as a substitute for ordinary appellate procedure, and so in general is not available where there is a remedy by writ of error or appeal.” Crystal, petitioner, 344 Mass. 583, 590 (1953); see Lamb, petitioner, 368 Mass. 491, 496 (1975) (where errors asserted in habeas corpus petition by a person adjudged a sexually dangerous person either were or could have been argued in the Appeals Court when that court first reviewed proceedings, those matters could not be reopened in a petition for habeas corpus); Crowell v. Commonwealth 352 Mass. 288, 289 (1967) (no habeas corpus relief where petitioner had remedy by writ of error for alleged violation of constitutional rights); Dirring, petitioner, 344 Mass. 522, 523-24 (1962) (no habeas corpus relief where constitutional error was not raised through appropriate appellate procedure); Crowley, petitioner, 54 Mass.App.Ct. 447, 451 (2002) (no habeas corpus relief where certiorari afforded petitioner a timely and effective method to review disciplinary proceeding). Relief on habeas corpus will be allowed where there was an opportunity for appeal only where the court that imposed the imprisonment acted without jurisdiction, rendering the proceedings and judgment void. Crystal, 344 Mass. at 591 (the rule that resort to habeas corpus cannot generally be had where appellate remedies are open “is subject to an exception where the court or magistrate by whose purported authority the imprisonment was imposed had no jurisdiction to impose it”); O’Leary, petitioner, 325 Mass. 179, 184 (1950).
After Stevens was found by the court to be a sexually dangerous person in the initial commitment proceeding, he appealed. That appeal provided Stevens a timely and effective method to challenge his status as a “prisoner” at the time the Commonwealth filed its petition for commitment. The legal and factual bases for such a challenge were knowable at the time Stevens filed his notice of appeal on October 3, 2006. The trial judge’s failure to credit Stevens with the days during which his sentence was stayed was knowable, and over one year earlier, on August 11, 2005, the Appeals Court had decided in Commonwealth v. Maldonado that considerations of fairness required a court to give jail credit where a defendant was held without bail during a stay of execution. Although Stevens appealed the court’s judgment finding him a sexually dangerous person to the Appeals Court, however, he chose not to pursue the appeal and voluntarily withdrew the appeal by filing a motion to dismiss the appeal with prejudice. The fact that his appeal was dismissed does not change the fact that the challenges he now raises as to his initial commitment could have and should have been asserted in that appeal.
Contrary to Stevens’s assertion, whether Stevens was a prisoner at the time the commitment petition was filed does not raise an issue as to the court’s fundamental jurisdiction to decide that petition and order his commitment. The legislature has provided that jurisdiction to determine a petition seeking commitment of an individual as a sexually dangerous *324person shall be in the superior court. See G.L.c. 123A, § 12(b). When the court determined the initial petition for commitment, it had jurisdiction and authority to do so. In deciding the petition, the court was not acting with total want of jurisdiction, such that the judgment of the court was wholly void, a complete nullity, and without legal effect. See Crystal 344 Mass. at 591; McIntire, petitioner, 458 Mass. 257, 264 (2010); Harris v. Sannella, 400 Mass. 392, 395 (1987). As stated by the Supreme Judicial Court, the § 12(b) requirement that the defendant be a “prisoner” when the petition is filed is a “threshold requirement for civil commitment as an SDP,” a “custodial prerequisite,” and a “statutory prerequisite.” Coffin v. Superintendent, Mass. Treatment Center, 458 Mass. 186, 189-90, 193 (2010). The Supreme Judicial Court has not ruled that this requirement involves an issue as to the court’s jurisdiction and authority, nor even referred to this requirement as affecting the jurisdiction of the court.3 See id. Further, even if this requirement were jurisdictional, an error in the court’s exercise of such jurisdiction in these circumstances would not render the court’s judgment void — "one which, from its inception, was a complete nullity and without legal effect." McIntire, 458 Mass. at 264, quoting Harris, 400 Mass. at 395. “Only in the rare instance of a clear usurpation of power will a judgment be rendered void.” McIntire, 458 Mass. at 264, quoting Harris, 400 Mass. at 395; see Crystal 344 Mass. at 591. Rather, the court’s judgment would simply be erroneous, not void, and subject only to direct attack. McIntire, 458 Mass. at 264, quoting Harris, 400 Mass. at 395 (“A void judgment is to be distinguished from an erroneous one, in that the latter is subject only to direct attack”); see Crystal 344 Mass. at 591 (habeas corpus relief available where order of the court was void because court acted without jurisdiction).
Accordingly, any alleged errors leading up to and including the order of commitment cannot now be litigated in this habeas corpus proceeding because Stevens had an opportunity to raise these issues with the Appeals Court when he appealed his commitment on the initial petition and the errors Stevens now seeks to litigate do not involve an issue of jurisdiction.
IV. Legality of Commitment as a Sexually Dangerous Person
Even if Stevens were entitled to pursue his challenge by means of habeas corpus, Stevens is not entitled to immediate release because he was a “prisoner” within the meaning of G.L.c. 123A, § 12(b) at the time the Commonwealth filed its petition to commit him as a sexually dangerous person. Section 12(b) permits the Commonwealth to file a petition for civil commitment as a sexually dangerous person only for a “prisoner or youth in the custody of the department of youth services.” G.L.c. 123, §12(b). To qualify as a “prisoner” under the statute, an individual must be in custody serving a criminal sentence or awaiting trial. See Commonwealth v. Gillis, 448 Mass. 354, 358-59 (2007) (mentally ill person previously convicted of sex offenses who was involuntarily committed to Bridgewater State Hospital after completing his criminal sentence was not a “prisoner” under Section 12(b)).
In determining whether an individual is a “prisoner” and eligible for civil commitment under § 12(b), however, the fact that the individual is in custody or serving a sentence is not determinative. Coffin, 458 Mass. at 189-90. In Coffin, the Supreme Judicial Court held that the Commonwealth lacked the statutory prerequisite for filing a petition under § 12(b) because although the individual was in lawful custody at the time the Commonwealth filed the petition, he was not a “prisoner” under § 12(b) because the lifetime parole statute, under which his sentence was imposed, had been determined to be facially unconstitutional prior to the Commonwealth’s filing, and therefore his sentence was not valid at the time of the filing. Id. Thus, an individual is a “prisoner” under the statute only if he is serving a sentence imposed under a statute that is constitutionálly sound. Id.
Similarly, in Commonwealth v. Allen, the fact that the defendant was in custody was not determinative as to his status as a “prisoner” under § 12(b). Commonwealth v. Allen, 73 Mass.App.Ct. 862, 864 (2009). In Allen, at the time the Commonwealth filed its petition, the defendant was in custody solely as a result of a clerical error, that error being the failure of the clerk to calculate and include on the mittimus 58 days of jail credit. Id. at 862-64. The defendant filed a motion to correct his sentence by crediting him with the jail time he was due, and the court allowed the motion. Id. at 863. Recalculation of the defendant’s sentence with the additional jail credit in accordance with the court’s order revealed that the defendant’s sentence had already expired 18 days before the court’s order. Id. One day after the court ordered defendant’s sentence corrected and 19 days after his sentence should have expired, the Commonwealth filed a petition to have him committed as a sexually dangerous person. Id. Despite the fact that the defendant was in custody at the time the Commonwealth filed its petition, the Appeals Court in Allen held that he was not a “prisoner” within the meaning of § 12(b) at the time of the filing because his sentence had previously expired, and therefore he was not serving a sentence at the time of the filing and was in custody solely as a result of a clerical error. Id. at 864.
Stevens is presently committed as a sexually dangerous person to the Treatment Center from one day to his natural life, having been found to be sexually dangerous first by a judge in 2006 during the initial commitment proceedings and thereafter by a jury in 2008 during the prior §9 discharge proceedings. Relying on the Appeals Court’s decision in Allen, Stevens argues that he is entitled to immediate release from *325his civil commitment because he was not a “prisoner” at the time the Commonwealth filed its initial petition seeking to commit him as a sexually dangerous person, and the court therefore lacked jurisdiction to commit him, making his commitment unlawful. Steven asserts that like the defendant in Allen, he was in custody solely as a result of a clerical error — the failure of the court to credit him with the 6 days that he was held without bail while his sentence was stayed. Had he been given such credit, Stevens argues, he would not have been in custody serving a sentence on January 30, 2004 when the petition was filed because his sentence would have expired on January 25, 2004. Thus, Stevens concludes, he was not a “prisoner” at the time the commitment petition was filed on January 30, 2004, and his commitment as a sexually dangerous person is therefore unlawful, entitling him to immediate release.
The court does not find Stevens’s argument persuasive. At the time the Commonwealth filed the commitment petition on January 30, 2004, Stevens was in custody serving a sentence of 6 years to 6 years and a day, which sentence was legally imposed by the court upon his criminal conviction. His conviction was lawful and the sentence imposed was a legal sentence; neither were constitutionally infirm. Contra Coffin, 458 Mass, at 189-90. As of January 30, 2004, there had been no determination by a court that Stevens sentence was invalid.
Contrary to Stevens’s argument, the facts of this case are distinguishable from those in Allen, and the Appeals Court decision in Allen does not control. Unlike in Allen, the court’s failure to credit Stevens with 6 days of jail time for the period his sentence was stayed was a legal error, not a clerical error. General Laws c. 279, §33A provides: “The court on imposing a sentence of commitment to a correctional institution of the commonwealth, a house of correction, or a jail, shall order that the prisoner be deemed to have served a portion of said sentence, such portion to be the number of days spent by the prisoner in confinement prior to such sentence awaiting and during trial.” In accordance with G.L.c. 279, §33, when the court imposed the sentence, it awarded Stevens the 453 days of jail credit he was entitled to for the time he spent in confinement awaiting and during trial prior to the imposition of his sentence. The court correctly calculated the number of days that Stevens was held from the time of his arrest to the date the sentence was imposed, September 1, 1999, to be 453 days. The language of G.L.c. 279, §33 does not require a court to credit a defendant with time held in custody while execution of his sentence is stayed. Maldonado, 64 Mass.App.Ct. at 251. As the Appeals Court ruled in Maldonado, it is not the statute, but rather considerations of fairness and fair treatment which dictate that a court should credit a defendant with time held in custody during a stay of the sentence. Id. The trial court’s failure to credit Stevens with the 6 days his sentence was stayed was thus a legal error, not a clerical error. Moreover, the Maldonado decision, decided in 2005, was not decided at the time Stevens was sentenced in 1999, nor at the time he completed his sentence and the Commonwealth filed its commitment petition in January 2004. When the trial court sentenced Stevens in 1999, therefore, its mistake in not crediting Stevens with the days the sentence was stayed was not clear legal error.
At the time the Commonwealth filed the petition seeking to commit Stevens on January 30, 2004, he was in custody serving a sentence that had not been determined by a court to be unlawful. He was serving a valid sentence that was voidable for error, but not void. Where a judgment, or in this case a sentence, is erroneous, it is “voidable for error and not void, and is therefore valid until reversed through the legal process.” See McItire, 458 Mass at 265 (judgment in §9 discharge proceeding that petitioner was a sexually dangerous person, based upon insufficient evidence, “was voidable for error and not void,” and, therefore, was “valid until reversed through the legal process”); Lynch, petitioner, 379 Mass. at 760 (where defendant’s commitment to serve sentence resulted from unconstitutional revocation of parole and was erroneous, commitment “was voidable for error and not void, and, therefore, was valid until reversed through the legal process”); Lewis v. Commonwealth, 329 Mass. 445, 448 (1952) (sentence that was the product of unlawful conviction may be “erroneous and voidable for error but was not void until reversed”).
The fact that Stevens’s sentence was merely voidable for error at the time the petition was filed because no court had yet determined the sentence to be in error further distinguishes this case from Allen. In Allen, prior to the Commonwealth’s filing of the commitment petition, the trial court had allowed the defendant’s motion to correct his sentence and ordered that he be credited with 58 days of jail credit.4 Allen, 73 Mass.App.Ct. at 83-864. The trial court having corrected the error prior to the filing of the petition, a portion of the defendant’s sentence had been voided by the court prior to the petition being filed. The Appeals Court thus determined that the defendant’s sentence had ended prior to the filing of the petition. Id. Such is not the case here. Stevens did not seek to have his sentence corrected and have the days his sentence was stayed credited to his sentence until he filed this petition on September 23, 2010, six years after he completed his sentence5 and after the Commonwealth filed the petition for his commitment as a sexually dangerous person. While a portion — 6 days — of his sentence may have been voidable at the time the petition was filed, it was a valid, lawful sentence at that time, *326which had not expired. Stevens, therefore, was a “prisoner” under § 12(b) at the time the petition was filed.
Accordingly, because Stevens was a “prisoner” under § 12(b) on January 30, 2004, the Commonwealth satisfied the statutory prerequisite to the filing of the petition, and its petition for commitment of Stevens as a sexually dangerous person was valid. The court adjudicated Stevens a sexually dangerous person and committed him to the Treatment Center. He was subsequently found to remain a sexually dangerous person in a §9 proceeding and remains lawfully committed to the Treatment Center. Stevens is not entitled to immediate release from his commitment, and his petition will therefore be DENIED.
ORDER
For the foregoing reasons, it is hereby ORDERED that Stevens’s motion to correct miscalculation of jail credits, petition for habeas corpus, and motion for preliminary and permanent injunctive relief is DENIED.
Stevens asserts that he was entitled to 7 days of jail credit for the period from September 1, 1999 to September 7, 1999. However, the date on which Stevens began serving his sentence, September 7, 1999, should not be included in the calculation of such jail credits. The number of days creditable for this period was therefore 6 days.
Steven also argues that the DOC failed to credit him with 5 days of earned good time for work and education programs for month of January 2004. Stevens argument is without merit. As discussed above, the records of the DOC show that the DOC included 5 days for the month of January 2004 in its calculation of Stevens’s earned good time, thus bringing his earned good time to 132 days. Further, under G.L.c. 127, §129D, the Commissioner of DOC has discretion in awarding earned good time, and Steven’s claim for such good time is untimely.
As recognized by the dissent in Coffin, courts in other states have addressed the question of the lawfulness of the underlying imprisonment as a jurisdictional issue. Coffin, 458 Mass. at 193, n.5; see In re Detention of Keeney, 141 Wash.App. 318, 329-30 (2007); Larimore v. State, 2 So.3d 101, 114 (Fla. 2008). The Supreme Judicial Court has not done so.
Similarly, in Coffin, the Supreme Judicial had determined that the statute under which the defendant was serving his sentence was unconstitutional more than 5 months before the Commonwealth filed its petition seeking to commit the defendant as a sexually dangerous person.
Having completed his sentence, Stevens request that this court correct a miscalculation of his jail credits is moot.