
948 N.E.2d 795 (2011)
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Jesse COLEMAN, Defendant-Appellant.
No. 1-09-0417.
Appellate Court of Illinois, First District, Sixth Division.
April 29, 2011.
Rehearing Denied May 27, 2011.
*797 Anita Alvarez, Cook County State's Attorney (Alan J. Spellberg, Veronica Calderon Malavia, Tasha-Marie Kelly, Charles J. Proschaska, Assistant State's Attorney, of counsel), for Plaintiff-Appellee.
Michael J. Pelletier, State Appellate Defender, Alan D. Goldberg, Deputy Defender of Cook County (Byron M. Reina, Assistant Appellate Defender), for Defendant-Appellant.

OPINION
Justice McBRIDE delivered the judgment of the court, with opinion.
Following a bench trial, defendant Jesse Coleman was convicted of violating the armed habitual criminal statute (720 ILCS 5/24-1.7 (West 2006)). He was sentenced to eight years in prison. Defendant appeals, arguing that: (1) the State failed to prove beyond a reasonable doubt that defendant violated the armed habitual criminal statute because the name on one of the certified copies of conviction entered as evidence of a prior offense did not match defendant's name; (2) the armed habitual criminal statute violates the second amendment; (3) defendant's conviction for violating the armed habitual criminal statute violated the ex post facto clause of the United States Constitution; and (4) defendant *798 is entitled to an additional 32 days of presentence credit.
Defendant was charged with one count of being an armed habitual criminal (720 ILCS 5/24-1.7 (West 2006)), four counts of unlawful use of a weapon by a felon (720 ILCS 5/24-1.1 (West 2006)), and six counts of aggravated unlawful use of a weapon (720 ILCS 5/24-1.6 (West 2006)). The following evidence was presented at defendant's December 2008 bench trial.
Officer Michael Lachance testified that he is employed by the Chicago police department. On November 30, 2006, at approximately 7:40 p.m., Officer Lachance was in the area of 6501 South Paulina. He was working with a partner, Officer Keith Deitelhoff. They were in uniform and driving a marked police car. Officer Deitelhoff was driving. They went to that area pursuant to a call from the Office of Emergency Management. They were headed south on Paulina.
At that moment, a man walked in front of their car. Officer Lachance stated, "[h]e walked eastbound in front of the car, didn't look at us, just walked without even paying any attention that there was a car." Officer Lachance said the headlights to the car were on. When the man walked passed the car, Office Lachance noticed "a shiny object in his hand." The officer identified defendant as the man he saw walk in front of the car.
Officer Lachance testified that the shiny object was later revealed to be a handgun. It was shining "due to the fact that there was artificial light shining off of it." Defendant passed in front of the car with his left side closest to the car and the object was in his right hand. At that point, the officers exited their vehicle. They told him to stop and pulled out their firearms. Officer Lachance stated that defendant then threw the gun onto the roof of a church located at the southeast corner of the intersection. Officer Lachance testified that he observed defendant throw the gun with his right hand and he was able to see the gun from the time the gun left his hand until it landed on the roof. He saw the gun land about five to six feet from the gutter on the roof. He described the roof as very steep and pitched, a triangle. Officer Lachance stated that he was less than 10 feet from defendant when defendant threw the gun.
The officers told defendant to stop, but he did not. Officer Lachance put his firearm in the holster and attempted to place defendant into custody. He grabbed defendant's arm and defendant "tried aggressively pulling away." Office Lachance stated that they tried to cuff defendant, but he would not let them. After some struggling, a detective arrived and helped them place defendant in custody with handcuffs. As they were arresting him, defendant was saying multiple profanities. Officer Lachance also stated that defendant was intoxicated and he smelled alcohol on defendant's breath.
Officer Lachance testified that he called the fire department to assist in retrieving the gun by bringing a ladder. Once the ladder was in place, Officer Lachance climbed onto the roof and retrieved the gun. He did not see anything else on the roof other than the gun. He described the gun as a bluesteel revolver. It was loaded with four live rounds and no expended cartridges.
On cross-examination, Officer Lachance stated that defendant was transported by different officers to the station. He also said that he did not survey the entire roof; he went to the area where he knew defendant threw the gun. He estimated that he was on the roof for about a minute and a half. He testified that he observed Officer Deitelhoff inventory the gun at the police *799 station. He stated that he did not go on any calls while he was in possession of the gun.
In response to a question from the trial court, Officer Lachance further described the gun as a .38-caliber bluesteel revolver and was approximately five inches across by four inches down.
The State then entered copies of two certified copies of defendant's prior convictions into evidence. The first was a unlawful use of a weapon by a felon from 1997, and the other was a burglary conviction from 2002. Defendant did not object. The trial court admitted the convictions and the State rested.
Defendant moved for a directed finding. Defense counsel argued that the officer's testimony was insufficient to prove that the object was a gun. Defense counsel also asserted that the certified copies of the convictions were not sufficient proof that they are defendant's convictions because the certified copies did not contain any identifying information apart from defendant's name. Specifically, defendant's attorney noted that there was "no I.R. number" and no date of birth. The prosecutor responded that the officer testified that he saw a shiny object that he later recognized as a gun and he saw the gun leave defendant's hand and he never lost sight of the gun. The trial court granted the motion for four counts of aggravated unlawful use of a weapon, but denied the motion as to the other counts.
Defendant testified on his own behalf. He stated that on November 30, 2006, he was in the vicinity of 6501 South Paulina while waiting for a friend. He recalled seeing a police car when he was across the street headed toward the church. He stated that he had consumed "some drinks" and got out of the car "so [he] wouldn't catch a DUI." After he got out of the car, he needed to relieve himself so he was walking to the church to do so.
Defendant saw the police car driving southbound on Paulina. He said that when the police officers asked him to stop, he did not know they were speaking to him and he kept going. When he stopped, defendant testified that he "tossed the drinks in the air." He stated that he threw a bottle of gin mixed with grapefruit juice and a half can of beer. He denied having a gun and denied throwing a gun onto the church roof. He said he was then placed under arrest.
Defendant stated that Officer Lachance was in the police car with him when the fire truck came and Officer Lachance did not climb the ladder to retrieve anything from the church roof. He testified that Officer Deitelhoff got into the vehicle and said they were not needed there anymore. Defendant said he was transported to the police station by Officers Lachance and Deitelhoff. While at the police station, another officer came into the investigation room with a gun and gave Officer Deitelhoff the gun.
On cross-examination, defendant testified that he had consumed a half of a can of beer and had gotten "high" that night. Defendant stated that he had gin and then he said he had whiskey. Defendant testified that gin and whiskey were "the same thing." He mixed his drink with grapefruit juice because he could not get drunk. Defendant denied crossing the street in front of the police car. Defendant said he threw a bottle and it fell to the ground, but it did not break because it was plastic. Defendant testified that an officer did not climb the ladder to retrieve a gun from the church roof because they were in the car with him. He saw a fireman halfway up the ladder.
The defense rested after defendant's testimony. In rebuttal, the State presented *800 a certified copy of conviction for theft from 2001 to be used for impeachment, which the trial court allowed.
In closing argument, defense counsel argued that Officer Lachance's memory was "faulty" because he needed to refresh his recollection from his reports. Defense counsel also argued that the certified copies of prior convictions were not sufficient to establish proof beyond a reasonable doubt because other than defendant's name, there was no identifying information, such as, date of birth, "I.R." number, "SID" number, or FBI number.
Following arguments, the trial court found defendant guilty of all remaining counts, which merged into the one count of armed habitual criminal. The judge stated that he believed the officer's testimony over defendant's testimony. "I believe his testimony was clear and I thought he was a good witness. I don't believe the defendant's version of events." The judge also noted the name of defendant is sufficient prima facie proof that defendant is the person named in the convictions, and it was not called into question in this case.
Defendant filed a motion for a new trial, which the trial court denied. At the subsequent sentencing hearing, the trial court sentenced defendant to a term of eight years in prison, 85% of which defendant must serve. The judge stated that he considered all factors in aggravation, including defendant's "significant criminal history," as well as the factors in mitigation.
This appeal followed.
First, defendant argues that the State failed to prove him guilty of being an armed habitual criminal because the name on one of the certified copies of conviction does not match the spelling of defendant's name. Specifically, the certified copy of the 1997 conviction for unlawful use of a firearm by a felon names "Jessie Coleman" as the defendant, not Jesse Coleman. The State responds that the variant spelling of defendant's first name is not a sufficient deviation to defeat the presumption that defendant is the named person in the certified copy. The State also points out that defendant has used this spelling of his first name with the authorities on other occasions. The certified copy of the 2002 conviction for burglary names "Jesse Coleman" as the defendant.
When this court considers a challenge to a criminal conviction based upon the sufficiency of the evidence, it is not our function to retry the defendant. People v. Hall, 194 Ill.2d 305, 329-30, 252 Ill.Dec. 653, 743 N.E.2d 521 (2000). Rather, our inquiry is limited to "whether, after viewing the evidence in the light most favorable to the prosecution, any rational trier of fact could have found the essential elements of the crime beyond a reasonable doubt." (Emphasis in original.) Jackson v. Virginia, 443 U.S. 307, 319, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979); accord People v. Cox, 195 Ill.2d 378, 387, 254 Ill.Dec. 720, 748 N.E.2d 166 (2001). It is the responsibility of the trier of fact to "fairly * * * resolve conflicts in the testimony, to weigh the evidence, and to draw reasonable inferences from basic facts to ultimate facts." Jackson, 443 U.S. at 319, 99 S.Ct. 2781.
The armed habitual criminal statute under which defendant was convicted provides:
"(a) A person commits the offense of being an armed habitual criminal if he or she receives, sells, possesses, or transfers any firearm after having been convicted a total of 2 or more times of any combination of the following offenses:
(1) a forcible felony as defined in Section 2-8 of this Code;

*801 (2) unlawful use of a weapon by a felon; aggravated unlawful use of a weapon; aggravated discharge of a firearm; vehicular hijacking; aggravated vehicular hijacking; aggravated battery of a child; intimidation; aggravated intimidation; gunrunning; home invasion; or aggravated battery with a firearm; or
(3) any violation of the Illinois Controlled Substances Act or the Cannabis Control Act that is punishable as a Class 3 felony or higher.
(b) Sentence. Being an armed habitual criminal is a Class X felony." 720 ILCS 5/24-1.7 (West 2006).
As proof of one element of the armed habitual criminal statute, the State presented certified copies of two convictions: one for burglary, which is included in the definition of a forcible felony under section 2-8 of the Criminal Code of 1961 (720 ILCS 5/2-8 (West 2006)); and the other conviction was for unlawful use of a weapon by a felon, which listed the defendant as "Jessie Coleman."
The supreme court has "adopted a general rule that `identity of name gives rise to a rebuttable presumption of identity of person.'" People v. Smith, 148 Ill.2d 454, 465, 170 Ill.Dec. 644, 593 N.E.2d 533 (1992) (quoting People v. Davis, 95 Ill.2d 1, 31, 69 Ill.Dec. 136, 447 N.E.2d 353 (1983)). In Davis, the supreme court, in adopting the rebuttable presumption of identity of person, reiterated its previous statement on this subject.
"`Earlier cases in this court would appear to preclude a judge from taking judicial notice of the orders or decrees entered in other cases in the court in which he presides. [Citations.] It has been repeatedly held that proof of prior convictions should be by means of certified copies of the record and identification of the defendant in the prior case as the same person. [Citations.] To the extent that these and similar holdings may be thought to create an inflexible rule requiring formal proof of earlier court records only by authenticated or certified copies of those records and proof of identity, they are incompatible with considerations of judicial economy and efficiency essential to the disposition of present-day caseloads. Nor do such procedures provide any necessary or useful safeguards to the defendants in cases such as this where the fact that the prior conviction had occurred has never been denied.'" Davis, 95 Ill.2d at 31, 69 Ill.Dec. 136, 447 N.E.2d 353 (quoting People v. Davis, 65 Ill.2d 157, 164, 2 Ill.Dec. 572, 357 N.E.2d 792 (1976)).
"Where the presumption is not rebutted, a defendant is not prejudiced by finding that a certified copy of his prior felony conviction, without more, meets the State's burden of proving this element beyond a reasonable doubt." People v. Moton, 277 Ill.App.3d 1010, 1012, 214 Ill.Dec. 731, 661 N.E.2d 1176 (1996) (citing Smith, 148 Ill.2d at 465, 170 Ill.Dec. 644, 593 N.E.2d 533). However, "[i]f the presumption does not apply or is rebutted, other evidence must be adduced to substantiate that the defendant is the person named in the record of conviction." Moton, 277 Ill.App.3d at 1012, 214 Ill.Dec. 731, 661 N.E.2d 1176.
Defendant contends that since the name on one of the certified copies of conviction was not identical to defendant's spelling of his first name, the State was required to offer additional evidence to establish that "Jessie Coleman" was defendant. We note that defense counsel did not object to the State's request to admit the prior certified copy of conviction at issue. Nor did defendant deny he was "Jessie" when he testified. However, defense counsel did argue on behalf of her motion for a directed finding that the certified copies for both *802 convictions did not contain sufficient identifying information to prove they were defendant's convictions.
Defendant relies on two Third District cases. In Moton, the defendant was charged with unlawful possession of a weapon by a felon and the State offered a certified conviction of "`William B. Morton'" from the State of Tennessee as proof a prior conviction. The defendant was initially charged in the case as "`William Moton,'" but the State later issued a new indictment charging defendant as "`William Moton a/k/a William B. Morton a/k/a William Morten.'" Moton, 277 Ill.App.3d at 1011, 214 Ill.Dec. 731, 661 N.E.2d 1176. The reviewing court found that there was no presumption of identity in this case because defendant used the name "Moton" throughout the case and the only proof of the alias was the new indictment, as the prosecutor did not present evidence of defendant's use of the alias. Moton, 277 Ill.App.3d at 1012-13, 214 Ill.Dec. 731, 661 N.E.2d 1176.
Similarly, in People v. Brown, 325 Ill. App.3d 733, 259 Ill.Dec. 802, 759 N.E.2d 582 (2001), the reviewing court reversed the defendant's conviction for possession of a weapon by a felon. There, the State offered a certified conviction for "John Brown," but the defendant's name was "John E. Brown." The court found that the difference in the name was sufficient to defeat the presumption of identity, and no other evidence was presented to show that "John Brown" and "John E. Brown" are the same person. Brown, 325 Ill.App.3d at 735, 259 Ill.Dec. 802, 759 N.E.2d 582.
However, in People v. Bell, 327 Ill. App.3d 238, 240, 261 Ill.Dec. 936, 764 N.E.2d 551 (2002), the Third District distinguished its holding in Brown in finding that the defendant failed to object to the admission of the certified copy of conviction and conceded that the State could "`prove it up.'" There, the defendant was indicted under the name "`Shawn Earl Bell AKA: Bell, Shawn E'" for unlawful possession of a weapon by a felon. The State presented a certified copy of conviction under the name "`Shawn Bell'" as its proof of that element. The defendant did not object, and his attorney admitted that the prosecutor could prove the conviction. Bell, 327 Ill.App.3d at 240, 261 Ill.Dec. 936, 764 N.E.2d 551.
On appeal, the defendant relied on Brown, but the reviewing court found Brown to be "inapposite to this case."
"Brown is readily distinguishable from this case. Here, the defendant did not object to the State's introduction of the certified copy of conviction. On the contrary, he accepted the judge's suggested manner of handling this evidence and never argued that he was not the person named in the certified copy of conviction." Bell, 327 Ill.App.3d at 241, 261 Ill.Dec. 936, 764 N.E.2d 551.
The Bell court then pointed out that "[a] defendant may not ask the trial court to proceed in a certain manner and then contend in a court of review that the judgment he obtained was in error." Bell, 327 Ill.App.3d at 241, 261 Ill.Dec. 936, 764 N.E.2d 551 (citing People v. Segoviano, 189 Ill.2d 228, 244, 244 Ill.Dec. 388, 725 N.E.2d 1275 (2000)). The court stated that the defendant asked the trial court to proceed with the introduction of the certified copy of conviction in a certain manner, including conceding the State could prove the conviction, and then claimed error on appeal. The court found that the defendant could not claim error on appeal after the trial court did as he wanted. The court concluded that after viewing the evidence in the light most favorable to the State, a reasonable jury could have found that defendant was a felon. Bell, 327 Ill. *803 App.3d at 241, 261 Ill.Dec. 936, 764 N.E.2d 551.
Here, defendant did not object to the admission of the certified copy of conviction under the name "Jessie Coleman" nor did his trial counsel argue that the variant of defendant's name rendered the conviction insufficient to prove an element of the armed habitual criminal charge. We also note that defendant has never asserted either at trial or on appeal that he did not commit that crime and was not the defendant in that case. We do not find that the variance between "Jesse" and "Jessie" sufficient to defeat the initial presumption of identity and defendant did not present any evidence to the trial court to rebut the presumption.
We also find Brown and Moton to be distinguishable. Brown concerned a very common first and last name, "John Brown," and the defendant's attorney in that case argued that the defendant was not the same "John Brown" from the certified conviction. Moton presents an even more compelling case of a failure to satisfy the presumption of identity when the defendant's last name was "Moton" and the certified copy of conviction was under the name "Morton" and no evidence was presented to prove that both names were defendant.
While not part of the substantive evidence of the underlying offense, the record indicates that defendant's criminal history report named defendant as "Jessie Coleman" and listed defendant's use of "Jessie Coleman" as an alias at least eight times from 1975 to 2002, as well as four convictions under the name "Jessie Coleman."
After reviewing the evidence in the light most favorable to the State, we conclude that the trier of fact could have found that defendant was the same person named in the certified copy of conviction for unlawful use of a weapon by a felon in 1997. Accordingly, we affirm defendant's armed habitual criminal conviction.
Next, defendant contends that the armed habitual criminal statute (720 ILCS 5/24-1.7 (West 2006)) violates the second amendment because it criminalizes the mere possession of a firearm by certain individuals. Defendant bases his constitutional argument the United States Supreme Court's recent decisions in District of Columbia v. Heller, 554 U.S. 570, 128 S.Ct. 2783, 171 L.Ed.2d 637 (2008) and McDonald v. City of Chicago, Illinois, ___ U.S. ___, 130 S.Ct. 3020, 177 L.Ed.2d 894 (2010). Defendant contends that the armed habitual criminal statute is unconstitutional on its face and as applied to him.
Defendant admits that he has raised this issue for the first time on appeal, but contends he has not forfeited the issue because a constitutional challenge can be raised at any time. To preserve an issue for review, a defendant must both object at trial and in a written posttrial motion. People v. Enoch, 122 Ill.2d 176, 186, 119 Ill.Dec. 265, 522 N.E.2d 1124 (1988). However, as defendant asserts, "a constitutional challenge to a criminal statute can be raised at any time." In re J.W., 204 Ill.2d 50, 61, 272 Ill.Dec. 561, 787 N.E.2d 747 (2003); see also People v. Wright, 194 Ill.2d 1, 23, 251 Ill.Dec. 469, 740 N.E.2d 755 (2000); People v. Bryant, 128 Ill.2d 448, 454, 132 Ill.Dec. 415, 539 N.E.2d 1221 (1989); People v. Bailey, 396 Ill.App.3d 459, 462, 335 Ill.Dec. 741, 919 N.E.2d 460 (2009) ("While it is true, and defendant concedes, that he did not preserve this issue accordingly, we note that we are dealing with a constitutional challenge involving the validity of a statute. Such an argument may be presented at any time, regardless of a violation of technical waiver rules.")
*804 "`[A]ll statutes are presumed to be constitutional, and the burden of rebutting that presumption is on the party challenging the validity of the statute to demonstrate clearly a constitutional violation.'" People v. Dinelli, 217 Ill.2d 387, 397, 299 Ill.Dec. 236, 841 N.E.2d 968 (2005) (quoting People v. Greco, 204 Ill.2d 400, 406, 274 Ill.Dec. 73, 790 N.E.2d 846 (2003), citing People v. Sypien, 198 Ill.2d 334, 338, 261 Ill.Dec. 294, 763 N.E.2d 264 (2001)). Further, a court, whenever reasonably possible, must construe a statute to uphold its constitutionality. Dinelli, 217 Ill.2d at 397, 299 Ill.Dec. 236, 841 N.E.2d 968. We review the constitutionality of a statute de novo. Dinelli, 217 Ill.2d at 397, 299 Ill.Dec. 236, 841 N.E.2d 968.
Defendant asserts that under Heller and McDonald, "the criminalization of possession of a handguneven relating to someone twice-convicted of certain qualifying offensesis an unconstitutional infringement on the right to bear arms. [Defendant's] mere possession of a handgun is conduct protected at the very core of the Second Amendmentconduct that the amendment `elevates above all other interests.' Heller, 554 U.S. at 635 [128 S.Ct. 2783]." Defendant further contends that the armed habitual criminal statute infringes on his right to bear arms for self-defense.
Recently, a different panel of the Sixth Division considered and rejected a similar constitutional challenge of the armed habitual criminal statute. People v. Ross, 407 Ill.App.3d 931, 349 Ill.Dec. 762, 947 N.E.2d 776 (2011). In Ross, the defendant, like defendant in the instant case, challenged the constitutionality of the armed habitual criminal statute based on the Supreme Court's decisions in Heller and McDonald. That decision considered Heller and McDonald as well as the many recent cases declining to find that the aggravated unlawful use of a weapon statute violates the Second Amendment. See People v. Dawson, 403 Ill.App.3d 499, 343 Ill.Dec. 274, 934 N.E.2d 598 (2010); People v. Williams, 405 Ill.App.3d 958, 346 Ill. Dec. 95, 940 N.E.2d 95 (2010); People v. Aguilar, 408 Ill.App.3d 136, 348 Ill.Dec. 575, 944 N.E.2d 816 (2011).
We concluded that both Heller and McDonald were limited to question presented, i.e., the right to possess a handgun in the home for self-defense is protected under the second amendment as a fundamental right. Ross, 407 Ill.App.3d at ___- ___, 349 Ill.Dec. at 770-72, 947 N.E.2d at 784-86.
"Our United States Supreme Court has never indicated that a felon can possess a firearm in a home or outside of a home. In fact, the majority in Heller stated that `nothing in our opinion should be taken to cast doubt on long-standing prohibitions on the possession of firearms by felons and the mentally ill, or laws forbidding the carrying of firearms in sensitive places such as schools and governmental buildings, or laws imposing conditions on the commercial sale of arms.'" (Emphasis in original.) Ross, 407 Ill.App.3d at ___, 349 Ill.Dec. at 770, 947 N.E.2d at 784 (quoting Heller, 554 U.S. at 626-27, 128 S.Ct. 2783).
The Ross decision further noted:
"The United States Supreme Court in McDonald recognized that federal and state legislatures and local governments have police powers to pass laws that promote the health, safety, and general welfare of their citizens and that the police power includes the power to regulate certain aspects of gun possession and ownership. The Court stated:
`We made in clear in Heller that our holding did not cast doubt on such longstanding regulatory measures as "prohibitions *805 on the possession of firearms by felons and the mentally ill," "laws forbidding the carrying of firearms in sensitive places such as schools and government buildings, or laws imposing conditions and qualifications on the commercial sale of arms." [Heller, 554 U.S. at 646, 128 S.Ct. 2783.]
We repeat those assurances here. Despite municipal respondents' doomsday proclamations, incorporation does not imperil every law regulating firearms.'" (Emphasis omitted) Ross, 407 Ill.App.3d at ___, 349 Ill.Dec. at 772, 947 N.E.2d at 786 (quoting McDonald, 561 U.S. at ___, 130 S.Ct. at 3047).
This court held that "the armed habitual criminal statute is a constitutionally permissible restriction of the second amendment right to bear arms, as a valid exercise of government's right to protect the health, safety, and general welfare of its citizens. The restriction serves a substantial governmental interest and is proportional to the interest served." Ross, 407 Ill.App.3d at ___, 349 Ill.Dec. at 773, 947 N.E.2d at 787.
We find the analysis in Ross to be thoughtful and well reasoned, and accordingly, we adopt its conclusion upholding the constitutionality of the armed habitual criminal statute. Therefore, defendant's constitutional challenge of the armed habitual criminal statute fails.
Defendant next asserts that his conviction for violating the armed habitual criminal statute violates the ex post facto clause of the Illinois and United States Constitutions because the offense increased the punishment for conduct that occurred before the effective date of the legislation creating the offense. The State responds that defendant's claim fails because "Illinois courts have consistently and correctly affirmed the constitutionality of the [armed habitual criminal statute] and denied defendants' ex post facto challenges." See People v. Bailey, 396 Ill.App.3d 459, 335 Ill.Dec. 741, 919 N.E.2d 460 (2009); People v. Leonard, 391 Ill.App.3d 926, 331 Ill.Dec. 582, 911 N.E.2d 403 (2009); People v. Davis, 405 Ill.App.3d 585, 346 Ill.Dec. 343, 940 N.E.2d 712 (2010); People v. Adams, 404 Ill.App.3d 405, 343 Ill.Dec. 685, 935 N.E.2d 693 (2010); People v. Thomas, 407 Ill.App.3d 136, 347 Ill.Dec. 889, 943 N.E.2d 179 (2011); Ross, 407 Ill.App.3d 931, 349 Ill.Dec. 762, 947 N.E.2d 776.
As we previously observed, we presume that all statutes are constitutional and the burden to rebut this presumption is on the party challenging the validity of the statute. Whenever possible, we will construe a statute to uphold its constitutionality and we review a constitutional challenge de novo. Dinelli, 217 Ill.2d at 397, 299 Ill. Dec. 236, 841 N.E.2d 968.
"Both the Illinois and United States Constitutions prohibit ex post facto laws. Ill. Const.1970, art. I, § 16; U.S. Const., art. I, § 9, cl. 3; § 10, cl. 1. An ex post facto law is one that (1) makes criminal and punishable an act innocent when done; (2) aggravates a crime, or makes it greater than it was when committed; (3) increases the punishment for a crime and applies the increase to crimes committed before the enactment of the law; or (4) alters the rules of evidence to require less or different evidence than required when the crime was committed." Leonard, 391 Ill.App.3d at 931, 331 Ill.Dec. 582, 911 N.E.2d 403. The Third District in Leonard noted that "[w]hen challenged as violating ex post facto prohibitions, recidivist statutes in this state have consistently been found constitutional on the basis that they punish a defendant for a new and separate crime, not for the earlier offense committed before the statute was enacted." Leonard, 391 Ill.App.3d at 931, 331 Ill.Dec. 582, 911 N.E.2d 403. The Leonard *806 court observed that under these recidivist statutes, the prior offenses are only an element of the new crime Leonard, 391 Ill.App.3d at 931, 331 Ill.Dec. 582, 911 N.E.2d 403.
Here, defendant argues that since his prior convictions are an element of the offense and they occurred before the effective date of the enactment of the armed habitual criminal statute, August 2, 2005, his conviction violated the ex post facto clause. We disagree.
The Leonard court found that the defendant had ample warning before committing the new offense and he was not being punished for his prior offenses, but instead was being punished for the new crime of possessing a firearm after having been convicted of three of the statute's enumerated offenses. Leonard, 391 Ill.App.3d at 931-32, 331 Ill.Dec. 582, 911 N.E.2d 403. This same conclusion has been reached in several other appellate decisions. See Bailey, 396 Ill.App.3d at 464, 335 Ill.Dec. 741, 919 N.E.2d 460 ("We find no reason to depart from the holding of our sister court on this issue. It is clear to us that, contrary to defendant's contention here, the armed habitual criminal statute does not punish him for the drug offenses he committed in 1997 before the statute's effective date but, rather, properly punishes him for, as he himself points out, the new and separate crime he committed in 2006 of possessing firearms while having already been convicted of two prior enumerated felonies, an offense of which he had fair and ample warning."); Adams, 404 Ill.App.3d at 413, 343 Ill.Dec. 685, 935 N.E.2d 693; Davis, 405 Ill.App.3d at 596, 346 Ill.Dec. 343, 940 N.E.2d 712; Thomas, 407 Ill.App.3d at 141, 347 Ill.Dec. 889, 943 N.E.2d 179; Ross, 407 Ill.App.3d at ___, 349 Ill.Dec. at 774, 947 N.E.2d at 788.
Defendant contends that we should reject these decisions because they conflict with People v. Dunigan, 165 Ill.2d 235, 209 Ill.Dec. 53, 650 N.E.2d 1026 (1995). The Dunigan court held that the Habitual Criminal Act (Ill.Rev.Stat.1989, ch. 38, par. 33B-1 et seq. (now 720 ILCS 5/33B-1 et seq. (West 2008))) did not violate ex post facto principles because it only enhanced the sentence for a new crime. Dunigan, 165 Ill.2d at 240-44, 209 Ill.Dec. 53, 650 N.E.2d 1026. However, the court in Leonard addressed this contention, finding that the Dunigan court did not hold that "habitual criminal legislation cannot include prior convictions as elements of an offense; they merely indicated that the statute in question * * * was a sentencing enhancement, not a substantive offense." Leonard, 391 Ill.App.3d at 932, 331 Ill.Dec. 582, 911 N.E.2d 403; see also Dunigan, 165 Ill.2d at 242, 209 Ill.Dec. 53, 650 N.E.2d 1026. In contrast, under the armed habitual criminal statute, defendant is being punished for his new offense, not his prior convictions. Leonard, 391 Ill.App.3d at 932, 331 Ill.Dec. 582, 911 N.E.2d 403.
We see no reason to depart from the holdings of Leonard, Bailey, Adams, Davis, Thomas, and Ross. Accordingly, defendant's ex post facto challenge fails.
Finally, defendant asserts that he is entitled to 796 days of presentence credit, but only received credit for 764 days. Defendant's original calculation included the day he was sentenced, but in light of the Illinois Supreme Court's decision in People v. Williams, 239 Ill.2d 503, 347 Ill.Dec. 677, 942 N.E.2d 1257 (2011), which held that a defendant is not entitled to presentence credit for the day of sentencing, defendant has withdrawn his request for that day and asks for 795 days of presentence credit. The State responds that defendant failed to establish that he spent was in custody for the additional 31 days.
We agree with defendant. Our review of the record shows that defendant remained in custody from his November 30, *807 2006, arrest until he was sentenced on February 3, 2009, and is entitled to presentence credit for 795 days. Under Supreme Court Rule 615(b)(1), this court has the authority to order a correction of the mittimus. Ill. S.Ct. R. 615(b)(1). We order the mittimus to be corrected to reflect 795 days of presentence credit for time spent in custody.
Based on the foregoing reasons, we affirm defendant's conviction and the mittimus is corrected as ordered.
Affirmed; mittimus corrected.
Presiding Justice GARCIA and Justice CAHILL concurred in the judgment and opinion.
