
23 S.W.3d 738 (2000)
Michael P. ROY, Appellant,
v.
MISSOURI DEPARTMENT OF CORRECTIONS, Respondent.
No. WD 57724.
Missouri Court of Appeals, Western District.
May 31, 2000.
As Modified August 1, 2000.
Motion for Rehearing and/or Transfer Denied August 1, 2000.
*741 Michael P. Roy, Jefferson City, pro se.
Stephen D. Hawke, Asst. Atty. Gen., Jefferson City, for respondent.
Before BRECKENRIDGE, C.J., LOWENSTEIN and EDWIN H. SMITH, JJ.
Motion for Rehearing and/or Transfer to Supreme Court Denied August 1, 2000.
PATRICIA BRECKENRIDGE, Chief Judge.
Michael P. Roy appeals the dismissal of his petition for declaratory judgment for failure to state a claim upon which relief could be granted. Mr. Roy is currently serving sentences in the Missouri Department of Corrections for two counts of the class C felony of forgery imposed by the Circuit Court of Clay County. In his petition, Mr. Roy sought a declaration from the trial court that he is entitled to credit on his Clay County sentences for time he served in the Jackson County jail and in the Missouri Department of Corrections on various Jackson County felonies which were unrelated to the Clay County forgery charges. On appeal, Mr. Roy claims that the trial court clearly erred in dismissing his petition because (1) a prisoner may file a petition for declaratory judgment seeking a determination that he or she is entitled to credit toward the completion of a sentence pursuant to § 558.031, RSMo 1994;[1] (2) as a matter of law, he is entitled to credit toward his Clay County sentences for time he spent in the Jackson County jail awaiting sentencing on the Clay County charges; (3) as a matter of law, he is entitled to credit toward his Clay County sentences for time he spent in the department of corrections after he was convicted of the Jackson County felonies and while he was awaiting sentencing on the Clay County charges; (3) the department of corrections' rescission of credit on his sentences four years after the entry of his guilty plea violated his right to due process of law; and (4) the department of corrections' rescission of credit on his sentences violated his right to equal protection of the law.
The judgment of the trial court is affirmed, in part, and reversed and remanded, in part.

Factual and Procedural Background
In reviewing the trial court's dismissal of a petition for failure to state a claim upon which relief could be granted, this court deems the facts pleaded in the petition to be true. Duvall v. Silvers, Asher, Sher & McLaren, M.D.'s, 998 S.W.2d 821, 823 (Mo.App.1999). In his petition, Mr. Roy alleged that in May of *742 1994, he was charged in the Circuit Court of Clay County with committing two counts of the class C felony of forgery. In June of 1994, he was charged in the Circuit Court of Jackson County with committing the class C felonies of forgery, burglary, stealing and receiving stolen property. Mr. Roy was arrested and taken into custody in Jackson County on June 10, 1994. On that same day, after learning that Mr. Roy was in custody in Jackson County, the Clay County Sheriff's Department filed a detainer against Mr. Roy for the two counts of forgery in Clay County.
On December 1, 1994, the Circuit Court of Jackson County sentenced Mr. Roy to terms of seven years imprisonment each on the counts of forgery, burglary, stealing and receiving stolen property, to be served concurrently. On December 6, 1994, Mr. Roy began serving his sentences on the Jackson County charges in the Missouri Department of Corrections.
Mr. Roy subsequently pleaded guilty to the Clay County forgery charges. On September 21, 1995, the Circuit Court of Clay County sentenced him to terms of seven years imprisonment on each of the two counts, to be served concurrently to each other and to the Jackson County sentences. The sentencing court also ordered that Mr. Roy receive credit on his Clay County sentences for all the time he spent in custody after June 10, 1994.
After Mr. Roy was sentenced, the department of corrections initially calculated his term of imprisonment for the Clay County felonies to be from June 10, 1994, the date he was taken into custody in Jackson County, to June 9, 2001. In June of 1999, however, the department recalculated Mr. Roy's sentences. Pursuant to the recalculation, the department determined that Mr. Roy's term of imprisonment for the Clay County felonies began on September 21, 1995. As a result, Mr. Roy's release date for the Clay County felonies was changed to September 20, 2002.
In response to the department's recalculation, Mr. Roy filed a petition for declaratory judgment. In the petition, Mr. Roy sought a declaration that he is entitled to credit on the Clay County sentences for the time he served in the Jackson County jail from June 10, 1994 to December 6, 1994, because Clay County had filed a detainer against him in Jackson County. Mr. Roy also sought a declaration from the court that he is entitled to credit on the Clay County sentences for the time he served in the department of corrections from December 6, 1994 to September 21, 1995, after he was sentenced on the Jackson County felonies but prior to being sentenced on the Clay County felonies. Mr. Roy contended in his petition that the department's rescission of credit on the Clay County sentences for the time he spent in the Jackson County jail and in the department of corrections violated his rights to due process of law and equal protection of the law.
In August of 1999, the trial court dismissed Mr. Roy's petition for declaratory judgment on the ground that the petition failed to state a claim upon which relief may be granted, and, in the alternative, that the chances of Mr. Roy's success on the merits were minimal. Mr. Roy filed this appeal.

Standard of Review
In determining the sufficiency of a petition for declaratory judgment, this court not only deems the facts pleaded to be true, but it also construes the averments liberally, and draws all reasonable and fair inferences from the facts pleaded. Duvall, 998 S.W.2d at 823. "If the allegations in the petition invoke principles of substantive law which, if proved, entitles the pleader to a declaration of rights or status, the pleading is sufficient and must not be dismissed." Kennedy v. Missouri Atty. Gen., 922 S.W.2d 68, 70 (Mo.App.1996). The petition must, however, contain facts to support its allegations, and not merely conclusions. Id. "If the facts *743 demonstrate any justiciable controversy, the trial court should declare the rights of the parties." Jones v. Carnahan, 965 S.W.2d 209, 214 (Mo.App.1998).

Declaratory Judgment Available to Determine Entitlement to Credit on Sentences
In his first point, Mr. Roy argues that the trial court clearly erred in dismissing his petition for failure to state a claim upon which relief could be granted because a declaratory judgment is available to prisoners seeking a determination that they are entitled to credit on their sentences. The State responds that Mr. Roy's petition sought much more than a determination of his entitlement to credit on his sentences. The State contends that Mr. Roy actually sought the calculation, recording, and crediting of time served. The State asserts that the only action available to provide Mr. Roy the relief he sought was a state habeas corpus proceeding.
Section 558.031 governs the calculation of terms of imprisonment and credit for time served while awaiting trial. This statute provides, in pertinent part, as follows:
1. A person convicted of a crime in this state shall receive as credit toward service of a sentence of imprisonment all time spent by him in prison or jail both while awaiting trial for such crime and while pending transfer after conviction to the department of corrections or the place of confinement to which he was sentenced. Time required by law to be credited upon some other sentence shall be applied to that sentence alone, except that
(1) Time spent in jail or prison awaiting trial for an offense because of a detainer for such offense shall be credited toward service of a sentence of imprisonment for that offense even though the person was confined awaiting trial for some unrelated bailable offense; and
(2) Credit for jail or prison time shall be applied to each sentence if they are concurrent.
* * *
At the time the trial court ruled on the motion to dismiss, the controlling rule of law was that the determination of jail time to be credited under § 558.031 was administrative and not judicial, "with no sharing of jurisdiction between the two branches of government." State ex rel. Jones v. Cooksey, 830 S.W.2d 421, 425 (Mo. banc 1992). Under this rule, "the sentencing court has no discretion in crediting jail time and it is the sheriff and the department of corrections, not the court, that calculate and record time served." Murphy v. State, 873 S.W.2d 231, 232 (Mo. banc 1994). "Therefore, a prisoner must request credit from the executive branch's department of corrections; administrative remedies and extraordinary writs of habeas corpus and mandamus are available to compel the executive to perform its duty to credit jail time." Id. Murphy and Jones indicate that after Mr. Roy exhausted his administrative remedies, his judicial remedy to obtain a determination of his entitlement to jail time credit was an extraordinary writ, and not a declaratory judgment.
After the case was submitted to this court, however, the Supreme Court issued its opinion in Goings v. Missouri Dept. of Corrections, 6 S.W.3d 906 (Mo. banc 1999). Mr. Goings sought credit for time served pursuant to § 558.031, RSMo Cum.Supp.1998. When the department of corrections refused to give him credit, Mr. Goings filed a declaratory judgment action in the Circuit Court of Cole County. Id. at 907. Mr. Goings appealed to the Supreme Court, challenging the constitutionality of § 558.031, RSMo Cum.Supp.1998, and the legality of the department's refusal to give him credit. Id. Deciding the case on the merits, the Supreme Court determined that Mr. Goings was, in fact, entitled to credit for time served under § 558.031, RSMo Cum.Supp.1998. Id. at 908. The Court directed the circuit court to enter a *744 declaratory judgment consistent with its finding.
Although the Court in Goings did not discuss the propriety of a prisoner seeking a determination of entitlement to credit on a sentence by way of a petition for declaratory judgment, it appears that the Court implicitly approved such a procedure when it reviewed Mr. Goings' claim on the merits. The failure to state a claim upon which relief can be granted is related to subject matter jurisdiction. Adkisson v. Director of Revenue, 891 S.W.2d 131, 132 (Mo. banc 1995). Thus, an appellate court "may sua sponte raise the issue whether a claim for relief has been stated even though not preserved by the parties." Id.; Rule 84.13(a). This court assumes that had the Court in Goings determined that a declaratory judgment petition was not a valid cause of action for Mr. Goings to assert to challenge the department's refusal to allow him credit on his sentence, the Court would have dismissed his petition for lack of subject matter jurisdiction.
This court is bound by the latest decision of the Supreme Court. State ex rel. Quest Commun. v. Baldridge, 913 S.W.2d 366, 371 (Mo.App.1996). Contrary to the State's assertions, Mr. Roy's petition, like Mr. Goings', challenged the department's refusal to give him credit for time served, and requested only a determination of whether he was entitled to credit. See Goings, 6 S.W.3d at 907. The Supreme Court's implicit approval in Goings of the declaratory judgment petition as a cause of action for a prisoner to request a determination of entitlement to credit under § 558.031 controls. Thus, Mr. Roy could properly request a determination of his entitlement to credit on his sentences in a declaratory judgment petition. This court grants Mr. Roy's first point.
Petition Stated Claim for Declaration of Entitlement to Credit Only For Time Served in Jackson County Jail Because of Clay County Detainer
In his second and third points, Mr. Roy contends that the trial court erred in dismissing his petition for declaratory judgment because, as a matter of law, § 558.031.1(1) entitles him to receive as credit toward his Clay County forgery sentences the time he spent in custody in the Jackson County jail between June 10, 1994 and December 6, 1994, and the time he spent in the department of corrections between December 6, 1994 and September 21, 1995. Resolution of Mr. Roy's point requires this court to construe § 558.031.1(1). When construing a statute, courts are to "ascertain the intent of the legislature from the language used and give effect to that intent, if possible, and to consider the words used in their plain and ordinary meaning." Butler v. Mitchell-Hugeback, Inc., 895 S.W.2d 15, 19 (Mo. banc 1995). "Courts look elsewhere for interpretation only when the meaning is ambiguous or would lead to an illogical result defeating the purpose of the legislature." State ex rel. Md. Heights v. Campbell, 736 S.W.2d 383, 387 (Mo. banc 1987).
The plain language of § 558.031.1(1) indicates that it creates an exception to the general rule that when a person convicted of a crime is allowed credit for time spent in prison or jail while awaiting trial for the crime, the credit applies to that sentence alone. The exception provides a person credit on a sentence for "[t]ime spent in jail or prison awaiting trial for an offense because of a detainer for such offense ... even though the person was confined awaiting trial for some unrelated bailable offense." Courts have interpreted this section to mean that a defendant who is in jail pending the disposition of one charge and against whom a detainer is filed for another charge, "`is then entitled to a credit for the time the detainer was in effect on the sentence resulting from the detained crime as well as credit against the sentence resulting from the offense for which he was originally jailed.'" State ex rel. Lightfoot v. Schriro, 927 S.W.2d 467, 470 (Mo.App.1996) (quoting State ex rel. *745 Blackwell v. Sanders, 615 S.W.2d 467, 469 (Mo.App.1981)).
Liberally construing the averments in Mr. Roy's petition and drawing all reasonable and fair inferences from the facts pleaded, Mr. Roy's petition alleged that while he was in jail in Jackson County awaiting trial on the four unrelated felony charges, which were bailable offenses pursuant to § 548.161, Clay County lodged a detainer against him for the two forgery charges. Under § 558.031.1(1) and cases such as Lightfoot and Blackwell which have interpreted this section, Mr. Roy sufficiently stated facts which, if proven, would entitle him to a declaration that he should be allowed credit on the Clay County forgery sentences for the time he spent in the Jackson County jail because of the Clay County detainer. The trial court erred in finding that Mr. Roy failed to state a claim for a declaration that he is entitled to credit on the two Clay County forgery sentences for this time period.
The trial court's alternative basis for dismissing this claim was that the chances of Mr. Roy's success on the merits were minimal. Mr. Roy was not allowed the opportunity to present evidence to support this claim before the trial court dismissed it. And, Mr. Roy is entitled to an adequate period to conduct discovery before a determination that he is unable to prove his claim. This court therefore remands to the trial court for further proceedings Mr. Roy's claim that he is entitled to credit toward his Clay County forgery sentences for time he served in the Jackson County jail because of the Clay County detainer. Mr. Roy's second point is granted.
In his third point, Mr. Roy contends that the exceptions contained in § 558.031.1 entitle him to credit for not only the time he spent in the Jackson County jail because of the Clay County detainer, but also for the time he spent in the department of corrections following the imposition of his Jackson County sentences while he was awaiting sentencing on the Clay County forgeries. He argues that the inclusion of the words "or prison" in the statute implies that the legislature intended that defendants receive credit on a sentence for an offense for time spent in the department of corrections because of convictions for unrelated offenses.
Mr. Roy's interpretation of § 558.031.1(1) ignores a critical requirement of the exceptionthat the confinement, whether it be in jail or prison, must be "because of a detainer for such an offense. ..." (Emphasis added). The time Mr. Roy served in the department of corrections awaiting trial on the Clay County forgery charges was not because of Clay County's detainer. Rather, the time Mr. Roy spent in the department of corrections was because of the imposition of the sentences for his Jackson County felony convictions. Under the plain language of subparagraph (1) of § 558.031.1, the time Mr. Roy served in the department of corrections because of the imposition of the Jackson County sentences does not qualify as credit toward his Clay County sentences. See Lightfoot, 927 S.W.2d at 471 n. 5.
Any claim by Mr. Roy that he is entitled to credit under subparagraph (2) of § 558.031.1 is contrary to this court's holding in Lightfoot, 927 S.W.2d at 472. The court stated:
While subsection 558.031.1(2) provides for an exception where sentences are ordered to be "concurrent," nothing in the language of that subsection requires that equal credit be given on all sentences for jail time served, even if it means giving credit retroactively for time served before the second sentence was imposed. To the contrary, the Missouri Supreme Court specifically stated in State ex rel. Blackwell v. Sanders, 615 S.W.2d 467 (Mo.App.1981) that Section 558.031.1(2) "does not specifically say that the same amount of jail time must be applied against each of the concurrent sentences." Id. at 469. It thus *746 refused to give the defendant credit for jail time served on a "concurrent" sentence before the defendant was even arrested on the second charge.
Lightfoot, 927 S.W.2d at 472. The court, in Lightfoot, applied the principle of Blackwell to hold that the defendant was not entitled to credit on a concurrent sentence which would give him credit for eight months he served in the department of corrections on an unrelated crime prior to the time his concurrent sentence was imposed. Id. The court ruled that § 558.031.1(2) does not require such a credit. Id. at 472-73.
The trial court did not err in finding that Mr. Roy's petition failed to state a claim upon which relief could be granted with regard to his request for a determination as to whether he is entitled to credit on his Clay County sentences for the time he served in the department of corrections between December 6, 1994 and September 21, 1995. Mr. Roy's third point is denied.

Petition Failed to Raise Viable Constitutional Claims
In his fourth and fifth points, Mr. Roy alleges that the department of correction's rescission of his credit on his sentences violated his rights to due process of law and to equal protection of the law. Mr. Roy's allegations of error in these points are based upon the rescission of credit for both the time he spent in the Jackson County jail and the time he served in the department of corrections.
In Mr. Roy's fourth point, he claims that the department of correction's rescission of his credit on his sentences four years after the imposition of the Clay County sentences violated his right to due process of law.[2] Mr. Roy alleges that his guilty plea to the Clay County felony charges was based upon his receiving credit for the time he spent in the department of corrections, and had he known that he would not receive this credit, he would have filed a motion to vacate his guilty plea on the basis that it was involuntarily and unknowingly made. Mr. Roy argues that by waiting until four years after the imposition of the sentences to inform him that he would not receive this credit, the department of corrections "stripped" him of any available post-conviction actions. Mr. Roy claims that in doing so, the department violated his substantive due process rights.
Mr. Roy did not plead this theory in his petition for declaratory judgment or in his memorandum in support of his petition. "In Missouri, parties are estopped from raising issues on appeal which were not raised at the trial court level." Walker v. Walker, 954 S.W.2d 425, 428 (Mo.App.1997). Reviewing his claim ex gratia, this court notes that the doctrine of substantive due process "requires the state action which deprives one of life, liberty or property, be rationally related to a legitimate state interest." Lane v. State Committee of Psychologists, 954 S.W.2d 23, 24 (Mo.App.1997). To assert a valid substantive due process claim, a plaintiff "`must establish that the government action complained of is `truly irrational', that is, something more than ... arbitrary, capricious, or in violation of state law.'" Frison v. City of Pagedale, 897 S.W.2d 129, 132 (Mo.App.1995) (quoting Anderson v. Douglas County, 4 F.3d 574, 577 (8 th Cir.1993)) (citation omitted). Mr. Roy makes no allegation that the department's action in recalculating his credit on his sentences to conform with the statutory guidelines established in § 558.031 was truly irrational and not related to a legitimate state interest. Instead, he admits that the department of corrections recalculated credit *747 due on sentences to incorporate the ruling of Lightfoot, 927 S.W.2d at 473. In his brief, Mr. Roy does not allege the necessary elements to plead a violation of his due process rights based upon the theory he asserts on appeal. Even if he were allowed to amend his petition to incorporate his new theory, he would fail to state a claim upon which relief could be granted.
In fact, the due process claim Mr. Roy attempted to raise in his petition also failed to allege that the department's recalculation of his credit on his sentences to conform with the statute was truly irrational and not related to a legitimate state interest. The only statement Mr. Roy made with regard to his due process claim in the petition was that the department violated his due process rights by rescinding his credit on his sentences four years after the sentence was imposed. Such a conclusory statement, without any supporting facts, fails to state a claim for declaratory relief. Kennedy, 922 S.W.2d at 70. The trial court properly dismissed the due process claim Mr. Roy attempted to raise in his petition.
The third theory upon which Mr. Roy based a due process claim was contained in his memorandum in support of his petition for declaratory judgment. While not properly plead in his petition, it is also reviewed ex gratia. In his memorandum, Mr. Roy argued that his due process rights were violated because § 558.031 is unconstitutionally vague. "The void-for-vagueness doctrine protects against arbitrary and discriminatory enforcement by ensuring that laws provide explicit standards for those who apply them." Lester v. Sayles, 850 S.W.2d 858, 873 (Mo. banc 1993). The test to determine whether a statute is sufficiently definite and certain to be constitutional is whether the words used in the statute "are of common usage and are understandable by persons of ordinary intelligence.'" Id. (quoting Prokopf v. Whaley, 592 S.W.2d 819, 824 (Mo. banc 1980)).
Applying this standard, the language of § 558.031.1 is explicit and understandable. Under this section, Mr. Roy is entitled to credit on his Clay County forgery sentences for the time he spent in jail or prison because of a detainer for those offenses, even though he was confined awaiting trial for unrelated Jackson County offenses. Once Mr. Roy was sent to the department of corrections, he was no longer in jail or prison because of the Clay County detainer. Therefore, he is not entitled to credit for that time. As a matter of law, this court finds that § 558.031.1 is not unconstitutionally vague. Since Mr. Roy did not raise a viable claim that the department's recalculation of his credit on his sentences to conform with § 558.031.1 violated his right to due process of law, the trial court did not err in dismissing this portion of his petition for declaratory judgment. Mr. Roy's fourth point is denied.
In Mr. Roy's fifth point, he argues that the department's rescission of credit on his Clay County sentences for the time he spent in the department of corrections while awaiting sentencing in Clay County violated his right to equal protection of the law. In support of his equal protection claim, Mr. Roy alleged in his petition that prior to the department's recalculation of his credit on his sentences, "thousands of similarly situated persons received sentence credit towards service of an imposed term of imprisonment for time spent in the Missouri Department of Corrections while awaiting sentencing on the same."
The petition failed to raise a proper equal protection claim. In Tyler v. Mitchell, 853 S.W.2d 338, 341 (Mo.App.1993), this court found that it was "not enough under the equal protection clause for a claimant to assert that he has been deprived of a benefit granted to others." Quoting J. Nowak, R. Rotunda, and J. Young, Handbook on Constitutional Law, 519 (1978), this court in Tyler stated:
The equal protection clause guarantees that similar individuals will be dealt with in a similar manner by the government. *748 It does not reject the government's ability to classify persons or "draw lines" in the creation and application of laws, but it does guarantee that those classifications will not be based upon impermissible criteria or arbitrarily used to burden a group of individuals.
* * *
It should be noted that the equal protection guarantee has nothing to do with the determination of whether a specific individual is properly placed within a classification. Equal protection tests whether the classification is properly drawn. It is the guarantee of procedural due process that determines what process is necessary to find that an individual falls within or outside of a specific classification. Equal protection deals with legislative line drawing and procedural due process with the adjudication of individual claims.
Id.
Pursuant to Tyler, Mr. Roy's complaint was in the nature of a procedural due process claim, not an equal protection claim. Like the claimant in Tyler, however, Mr. Roy's alleged factsthat thousands of other unnamed similarly-situated persons received credit on their sentences for time spent in the department of correctionsfailed to properly articulate a procedural due process claim. See id. The trial court did not err in dismissing Mr. Roy's complaint. Mr. Roy's fourth point is denied.
That portion of the trial court's judgment dismissing Mr. Roy's claim for a determination as to whether he is entitled to credit on his Clay County sentences for the time he spent in the Jackson County jail because of the Clay County detainer is reversed and remanded to the trial court for further proceedings consistent with this opinion. The trial court's dismissal of the remainder of Mr. Roy's petition is affirmed.
All concur.
NOTES
[1]  All statutory references are to the Revised Statutes of Missouri 1994, unless otherwise indicated. Section 558.031 was amended in 1995, and § 558.031.1, the portion of the statute at issue in this case, was substantially rewritten. Mr Roy's offenses were committed while the 1994 version was in effect, but the case was pending at the time of the 1995 amendment. See State v. Reiley, 476 S.W.2d 473, 474 (Mo. 1972). Neither of the exceptions contained in § 1.160 to the general rule that the version of the statute in effect at the time of the commission of the offenses, applies, however. Because a statute providing for pre-trial jail time credit has an effect on the punishment of the offense "by reducing the amount of time to be served after conviction by that amount of time spent in jail awaiting trial on the charge," State v. Whiteaker, 499 S.W.2d 412, 420 (Mo.1973), § 558.031 is not a procedural law under § 1.160(1). Moreover, the 1995 amendment to § 558.031 does not have the effect of reducing or lessening the punishment for Mr. Roy's offenses pursuant to § 1.160(2), as it does not entitle him to more credit.
[2]  In his fourth point, Mr. Roy also contends that the department's decision to rescind his credit on his sentences four years after he pleaded guilty violated the doctrine of laches. Because Mr. Roy did not address this issue in the argument following this point, however, this court deems the issue abandoned. Rogers v. Rogers, 923 S.W.2d 381, 384 (Mo.App.1996).
