
937 N.E.2d 190 (2010)
401 Ill. App.3d 678
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Erick N. JOHNSON, Defendant-Appellant.
No. 2-08-0693.
Appellate Court of Illinois, Second District.
June 7, 2010.
Thomas A. Lilien, Deputy Defender, Steven E. Wiltgen, Office of the State Appellate Defender, Elgin, for Appellant.
Louis A. Bianchi, McHenry County State's Attorney, Woodstock, Lawrence M. Bauer, Deputy Director, Mary Beth Burns, State's Attorneys Appellate Prosecutor, Elgin, for Appellee.
Justice BOWMAN delivered the opinion of the court:
Erick N. Johnson appeals the trial court's order denying his motion to amend the mittimus to reflect additional days of credit for time spent in custody prior to his conviction of criminal damage to property (720 ILCS 5/21-1(a) (West 2006)). The State contends that Johnson is not entitled to additional credit, under People v. Nicholson, 213 Ill.App.3d 765, 768, 157 Ill. Dec. 724, 572 N.E.2d 1188 (1991), but in light of more recent authority from our supreme court in People v. Robinson, 172 Ill.2d 452, 462-63, 217 Ill.Dec. 729, 667 *191 N.E.2d 1305 (1996), we do not apply Nicholson and we modify the mittimus to give Johnson 53 days of credit instead of the 29 days awarded by the trial court.

I. BACKGROUND
Johnson was charged by complaint on February 4, 2008. A warrant was issued and stamped as "rec'd" that same day and set bond at $50,000, but it was not served. That same warrant also was file-stamped on February 28, 2008. On February 19, 2008, the State informed the court that it believed Johnson was incarcerated in a Department of Corrections facility. The State asked that the warrant continue and serve as "a holder" while the State sought a writ to bring him before the court.
On February 21, 2008, an indictment was filed, and another warrant was issued that same day. The court ordered all previous warrants quashed and all bond requirements transferred to the warrant issued on the indictment. There is no indication that the warrant was ever served. On March 12, 2008, a writ of habeas corpus was issued to the warden of the correctional center where Johnson was incarcerated on unrelated charges.
On March 27, 2008, Johnson's counsel informed the court that the parties had negotiated a plea agreement, stating:
"I believe my client would be accepting the term of eight years which would run concurrent with [another] case * * * that was out of McHenry County. There would be no fine. The court costs, we'd ask the Court to take judgment on the court costs. My client has 29 days served from the time that this warrant was issued. Those are the terms and conditions of our negotiated plea."
There was then some discussion about how Johnson desired credit for time he spent in custody in the other case. That discussion appeared to relate to a period in 2007 that is not at issue in this appeal. Johnson was properly admonished, he pleaded guilty, and he was sentenced in accordance with the agreement as stated by his counsel.
On June 23, 2008, Johnson filed a pro se motion to amend the mittimus, making contentions about the time he spent in custody in 2007 and also contending that he was entitled to 36 additional days of credit based on the date of his indictment in this case. The trial court denied the motion without providing any reasoning other than stating that his "contention as to that issue is incorrect." Johnson appeals.

II ANALYSIS

A. Credit for Time Spent While in Custody for Another Offense
Citing to People v. Chamberlain, 354 Ill.App.3d 1070, 1074-75, 291 Ill.Dec. 39, 822 N.E.2d 914 (2005), Johnson contends that he is entitled to either 53 days' credit from the date of the complaint or 36 days' credit from the date of the indictment instead of the 29 days awarded by the trial court, apparently from the date the first warrant was file-stamped. The State, however, relies on Nicholson, 213 Ill.App.3d at 768, 157 Ill.Dec. 724, 572 N.E.2d 1188, to argue that Johnson was not in custody on the charge until the writ of habeas corpus was served, meaning that he actually received more days than he was entitled to. The State does not ask, however, that the amount of credit be lowered.
Section 5-8-7(b) of the Unified Code of Corrections provides that an offender "shall be given credit * * * for time spent in custody as a result of the offense for which the sentence was imposed." 730 ILCS 5/5-8-7(b) (West 2006). Section 5-8-7(b) requires that a defendant receive *192 the credit, and forfeiture rules do not apply. People v. Hernandez, 345 Ill.App.3d 163, 170, 281 Ill.Dec. 173, 803 N.E.2d 577 (2004). Our review in this case is de novo. See Robinson, 172 Ill.2d at 457, 217 Ill. Dec. 729, 667 N.E.2d 1305.
In Nicholson, 213 Ill.App.3d at 768, 157 Ill.Dec. 724, 572 N.E.2d 1188, the defendant was in custody in one county and indicted on other charges in a different county. A writ of habeas corpus was issued to the Department of Corrections, and the defendant was transferred for his first appearance on the charges at issue. Nicholson, 213 Ill.App.3d at 766-67, 157 Ill.Dec. 724, 572 N.E.2d 1188. When the defendant was sentenced, the State argued that, for purposes of calculating the credit, the issuance of the writ marked the date of custody, because that was when the defendant was first brought within the jurisdiction of the court. The defendant argued that the date should be the date of the indictment. Nicholson, 213 Ill.App.3d at 767, 157 Ill.Dec. 724, 572 N.E.2d 1188. We agreed that the time should run from the date of the writ. Nicholson, 213 Ill. App.3d at 768, 157 Ill.Dec. 724, 572 N.E.2d 1188.
In reaching our determination in Nicholson, we declined to follow the Fifth District case of People v. Higgerson, 157 Ill. App.3d 564, 567, 109 Ill.Dec. 706, 510 N.E.2d 574 (1987). There, the court allowed the defendant credit from the date his bond was set, even though a mittimus was issued the same day requiring him to serve time on an unrelated charge. The court reasoned that, even if the defendant had not been incarcerated on the unrelated charge, he would still have been held in jail for failure to post bond on the charge at bar. Higgerson, 157 Ill.App.3d at 566-67, 109 Ill.Dec. 706, 510 N.E.2d 574. However, we found Higgerson distinguishable because, there, it was ambiguous which charge was actually the basis of the defendant's custody, while in Nicholson, when the defendant was brought within the court's jurisdiction on a writ of habeas corpus, there was no such ambiguity. Nicholson, 213 Ill.App.3d at 768, 157 Ill.Dec. 724, 572 N.E.2d 1188. We also stated that, to the extent that Higgerson would find no ambiguity, we declined to follow it. Nicholson, 213 Ill.App.3d at 768, 157 Ill. Dec. 724, 572 N.E.2d 1188. The Fourth District has also applied the rule that "[s]entence credit will not be given for those days spent serving a prison term for a prior, unrelated offense," reasoning that such a rule is clear-cut and easy to follow. People v. Jones, 241 Ill.App.3d 262, 264-65, 181 Ill.Dec. 857, 608 N.E.2d 1331 (1993).
Here, Nicholson is on point and, were it the only case applied, the State would be correct that the time ran from the date of the writ of habeas corpus. However, Nicholson has been called into question by more recent cases.
In Robinson, 172 Ill.2d at 462-63, 217 Ill.Dec. 729, 667 N.E.2d 1305, our supreme court determined that, when a defendant is simultaneously in presentence custody on two unrelated charges, section 5-8-7(b) entitles him or her to credit on both offenses. There, while the defendant was released on bond, he was arrested for an unrelated offense and taken into custody. Because of that, the State moved to increase his bond in the first case, which he then surrendered in exoneration. After that, he remained in pretrial custody. Robinson, 172 Ill.2d at 454-55, 217 Ill.Dec. 729, 667 N.E.2d 1305. Applying both Higgerson and a speedy-trial case, People v. Arnhold, 115 Ill.2d 379, 383, 105 Ill.Dec. 231, 504 N.E.2d 100 (1987), the court reasoned that, even though a defendant is arrested on a second offense, he or she is returned to custody on the first offense when the bond is withdrawn or revoked. At that point, *193 the defendant is in simultaneous custody on both charges. Robinson, 172 Ill.2d at 459, 217 Ill.Dec. 729, 667 N.E.2d 1305. The court then determined that, under the plain language of section 5-8-7(b), a defendant is entitled to credit for time spent in custody as the result of the offense for which the sentence was imposed, and it stated that, while the basis of the custody may have been ambiguous for a time, other than the custody requirement there are no additional conditions that limit the application of section 5-8-7(b). Robinson, 172 Ill.2d at 462, 217 Ill.Dec. 729, 667 N.E.2d 1305. Thus, despite the ambiguity caused by the simultaneous custody, the withdrawal of the bond was a basis for the defendant's custody in the case at issue and he was entitled to credit based on that date. Robinson, 172 Ill.2d at 463, 217 Ill.Dec. 729, 667 N.E.2d 1305.
Robinson has since been expanded by the Third and Fifth Districts to apply to a defendant who is in custody serving a sentence on one charge at the same time that he or she is in presentence custody on an unrelated charge. People v. Chamberlain, 354 Ill.App.3d 1070, 1075, 291 Ill.Dec. 39, 822 N.E.2d 914 (2005); People v. Spencer, 347 Ill.App.3d 483, 490-91, 283 Ill.Dec. 387, 807 N.E.2d 1228 (2004). In Spencer, the defendant was in custody serving a sentence for one crime at the same time that he was in presentence custody on another charge, and the Fifth District gave credit against the new sentence for the time spent in simultaneous custody. In reaching that determination, the court applied reasoning similar to that of Higgerson  were the defendant not serving his sentence on the earlier charge, he would still have remained in custody for failure to post bond in the case at issue. Spencer, 347 Ill.App.3d at 490, 283 Ill.Dec. 387, 807 N.E.2d 1228. The court further stated that the issue was not the defendant's status in the unrelated case, but whether he remained in custody on the charge at bar. See Spencer, 347 Ill.App.3d at 490, 283 Ill.Dec. 387, 807 N.E.2d 1228.
In Chamberlain, the defendant was serving time in a youth center on an unrelated charge and sought credit for the time between when he was charged in the case at bar and when he was transferred from the youth center to a county jail. Chamberlain, 354 Ill.App.3d at 1074, 291 Ill.Dec. 39, 822 N.E.2d 914. Applying Robinson and Spencer, the Third District held that the defendant was in simultaneous custody during that time and extended the reasoning of those cases to circumstances that did not involve the revocation or withdrawal of a bond. Chamberlain, 354 Ill.App.3d at 1074-75, 291 Ill.Dec. 39, 822 N.E.2d 914. The court noted that the reasoning was the same as in cases involving bond revocation or withdrawalonce the defendant was charged with the present offense, he was simultaneously serving his prior sentence and in presentence custody. Thus, the court held that the defendant was entitled to credit from the date he was charged. Chamberlain, 354 Ill.App.3d at 1075, 291 Ill.Dec. 39, 822 N.E.2d 914.
Based on the evolution of the case law, we determine that the supreme court impliedly overruled Nicholson in Robinson, and to the extent that it did not do so, we decline to follow Nicholson. Nicholson reached its determination based on a rejection of reasoning that was later adopted by our supreme court in Robinson and expanded further by the appellate courts in Spencer and Chamberlain. Also, Nicholson relied on the premise that ambiguity because of simultaneous custody could prevent a defendant from being credited for time spent in simultaneous custody. That premise was clearly disallowed by Robinson.
*194 The State attempts to distinguish Robinson and Chamberlain, stating that those cases involved only the issue of the validity of simultaneous custody and did not address when custody began. But by addressing whether a defendant was entitled to credit for time spent in simultaneous custody, the cases necessarily contemplated the beginning point of that custody. In a case such as Robinson, that is when the bond is withdrawn or revoked. In a case such as Chamberlain, where the defendant is already serving a sentence on an unrelated offense, it is when he or she is charged, because, at that time, the defendant would be unable to be released because of the outstanding warrant and his or her failure to post bond on the new charge. Thus, contrary to the State's argument, Johnson is entitled to credit from the date that he was charged instead of from the date the writ of habeas corpus was issued.

B. Effect of the Plea Agreement
In the alternative, the State argues that Johnson agreed to credit of 29 days and must be held to that under the terms of the plea agreement. There is some support for the State's position. See People v. Williams, 384 Ill.App.3d 415, 416, 322 Ill.Dec. 882, 892 N.E.2d 129 (2008). However, we determine that it does not apply.
In Williams, the defendant agreed in part to 60 days in jail, with no presentence credit. On appeal, he sought to claim the credit. The Fourth District held that, under the doctrine of invited error, the defendant could not request to proceed in one manner and then later contend on appeal that the course of action was in error. Williams, 384 Ill.App.3d at 417, 322 Ill.Dec. 882, 892 N.E.2d 129. The court distinguished the matter from cases involving procedural default, stating that "[a] defendant has the right to first request sentencing credit at any time unless, as here, he agreed to forego it as part of a plea or other sentencing agreement." Williams, 384 Ill.App.3d at 417, 322 Ill. Dec. 882, 892 N.E.2d 129.
Although Williams provides support for the State's argument, we decline to apply it to Johnson's case. First, Williams ignored a previous case from the same appellate district holding exactly the opposite. In People v. Holt, 151 Ill.App.3d 337, 340, 104 Ill.Dec. 270, 502 N.E.2d 767 (1986), the defendant argued that the trial court exceeded its authority in accepting a plea agreement in which he was denied credit for time spent in custody. The Fourth District agreed, holding that section 5-8-7(b) requires application of the credit and that, without it, the plea agreement resulted in a sentence in excess of that permitted by statute. As a result, that portion of the plea agreement was void. Holt, 151 Ill.App.3d at 340, 104 Ill. Dec. 270, 502 N.E.2d 767. Second, unlike in Williams, where it was clear that the defendant expressly agreed to a plea agreement that did not include a proper calculation of the credit, here the agreement appeared to be focused mainly on the eight-year concurrent sentence. As Johnson notes, although his counsel stated that 29 days were part of the agreement, his counsel also referenced the date of the warrant, and there was a warrant issued on both the date of the complaint and the date of the indictment, arguably making either of those dates the basis of the agreement. Thus, the record does not show that the parties expressly agreed to a calculation of a credit that they knew was inaccurate. Instead, it appears equally likely that there was simply a miscalculation. Accordingly, we will modify the mittimus to give Johnson the correct number of days of credit.


*195 C. Calculating the Credit
Johnson argues that he is entitled to either 53 days of credit based on the date of the complaint or, in the alternative, 36 days of credit based on the date of the indictment.
Section 5-8-7(b) requires credit "for time spent in custody as a result of the offense for which the sentence was imposed." 730 ILCS 5/5-8-7(b) (West 2006). Under Chamberlain, Johnson was entitled to credit based on the date he was charged, because that is when custody began. Although the indictment was the charge that Johnson was prosecuted on, the complaint charged the same "offense" as the indictment, and a warrant was issued and bond set with each. Thus, under the reasoning of Chamberlain, once the complaint was filed and the warrant issued, even if Johnson's previous incarceration had suddenly ended, he still would have been held in custody on the warrant. Although the warrant on the complaint was quashed, it was superseded by the warrant on the indictment with no intervening time when a warrant was not outstanding. Accordingly, we determine that simultaneous custody began at the time of the complaint.
The State argues that the complaint was not sufficient to charge a felony, making the indictment the only applicable date, but the question is not whether the method for charging the offense was valid; it is when custody on the offense began. Also instructive on this point is section 5-8-7(c), which provides:
"An offender arrested on one charge and prosecuted on another charge for conduct which occurred prior to his arrest shall be given credit on the determinate sentence or maximum term and the minimum term of imprisonment for time spent in custody under the former charge not credited against another sentence." 730 ILCS 5/5-8-7(c) (West 2006).
Under the council commentary to section 5-8-7(c), that section "`provides for the case, not covered under former law, where all confinement since arrest is credited against the sentence even if the original charge is dropped in favor of a new charge with results in conviction and imprisonment.'" People v. Revell, 372 Ill. App.3d 981, 992, 311 Ill.Dec. 318, 868 N.E.2d 318 (2007), quoting 730 ILCS Ann. 5/5-8-7, Council Commentary-1973, at 622 (Smith-Hurd 1997). The purpose of subsection (c) is to prevent the State from defeating a defendant's right to credit for jail time by dropping one charge in favor of another charge based on the same conduct. People v. Kane, 136 Ill.App.3d 1030, 1036, 91 Ill.Dec. 737, 484 N.E.2d 296 (1985); see also Robinson, 172 Ill.2d at 460, 217 Ill.Dec. 729, 667 N.E.2d 1305 (discussing section 5-8-7(c)). Thus, to the extent the State argues that the indictment was a new charge, section 5-8-7(c) requires that credit be given from the date of the complaint. Accordingly, we modify the mittimus to give Johnson 53 days of credit based on the date of the complaint instead of the 29 days that were originally awarded.

III. CONCLUSION
Applying Robinson and Chamberlain, we determine that Johnson is entitled to additional credit based on the date of the complaint. Accordingly, under Supreme Court Rule 615(b) (134 Ill.2d R. 615(b)), we modify the mittimus to reflect 53 days of credit. Because Johnson does not challenge the denial of the remaining portions of his motion to modify the mittimus, the trial court's order denying Johnson's motion in all other respects is affirmed.
Affirmed as modified.
*196 McLAREN and JORGENSEN, JJ., concur.
