
831 N.E.2d 657 (2005)
357 Ill. App.3d 1070
294 Ill.Dec. 707
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Andrew R. WHITE, Defendant-Appellant.
No. 3-04-0708.
Appellate Court of Illinois, Third District.
June 3, 2005.
Rehearing Denied July 11, 2005.
*658 Carrie B. Marche (Court-appointed), Office of the State Appellate Defender, Ottawa, for Andrew R. White.
Lawrence M. Bauer, Deputy Director, State's Attorneys Appellate Prosecutor, Ottawa, Kevin W. Lyons, State's Attorney, Peoria, Dawn D. Duffy, State's Attorneys Appellate Prosecutor, Ottawa, for the People.
Justice LYTTON delivered the Opinion of the court:
The defendant, Andrew R. White, pled guilty to two counts of forgery (720 ILCS 5/17-3(a)(2) (West 2002)) and was sentenced to five years of imprisonment. He later filed a pro se motion for an order nunc pro tunc in which he contended that he was entitled to additional credit for his presentence incarceration (730 ILCS 5/5-8-7(b) (West 2002)). The trial court denied the motion. We grant defendant's request for additional credit.

FACTS
On September 16, 2003, the State filed an indictment charging the defendant with one count of theft and two counts of forgery. In the indictment, the State alleged that the defendant committed the theft in January 2003 and the forgeries in February 2003.
*659 On September 16, 2003, the trial court also issued a warrant for the defendant's arrest for the offenses in the present case. The defendant was arraigned on February 11, 2004. At the arraignment, the judge asked that the "warrant be served on the Defendant today in open court so that we can start his time running on this charge."
The court held the plea hearing on April 26, 2004. Under a fully negotiated agreement, the defendant offered to plead guilty to the two counts of forgery and the State offered to dismiss the theft count. The parties agreed that the State would recommend a sentence of five years' imprisonment. Among other conditions of the agreement, the judge explained that the defendant's "sentence would run concurrent [sic] with Case Number 03-CF-212 from Tazewell County." The judge accepted the defendant's guilty plea under the conditions of the agreement.
In addition to pleading guilty on April 26, the defendant was sentenced on that date. During the sentencing hearing, the prosecutor related the defendant's criminal history. The trial judge then asked, "And he was on parole when the Tazewell County and this offense occurred; is that right? And he got picked up on a parole violation and then pled guilty in Tazewell and then found out about this?" The defendant answered, "Yes."
The trial court sentenced the defendant to five years' imprisonment. The court gave the defendant credit for 76 days served in presentence incarceration. The defendant did not file a motion to withdraw the guilty plea.
On June 14, 2004, the defendant filed a pro se nunc pro tunc motion claiming that he was arrested for violating mandatory supervised release (MSR) for another offense by committing the conduct that led to the charges in this case. In his motion, the defendant did not give any other information concerning his arrest for violating his MSR. In his appellant's brief, the defendant alleged that the arrest occurred on either March 9 or March 11, 2003. We have taken judicial notice of certain Department of Corrections (DOC) records as they are public documents. See People v. DuPree, 353 Ill.App.3d 1037, 289 Ill.Dec. 784, 820 N.E.2d 560 (2004). These records indicate that defendant was arrested on March 11, 2003, for violating his MSR because of the criminal conduct that led to the charges in the instant case.
The trial court denied defendant's motion, stating the following:
"[T]he Court having reviewed the file hereby finds that Defendant was served with the Peoria County Warrant on February 11, 2004 and was sentenced on April 26, 2004. Therefore, he is only entitled to 76 days [sic] credit. The remainder of his time was served pursuant to a parole hold. He does not receive credit for that time."

ANALYSIS

I.
The State argues that defendant's nunc pro tunc motion was not a proper motion to obtain the relief sought, that is, a request for additional credit for time served.
The purpose of a nunc pro tunc order is to make the present record correspond with what the court actually decided in the past. Such orders may be used to correct clerical errors, but may not be used to challenge a court's previous decision. People v. Denny, 238 Ill.App.3d 819, 178 Ill.Dec. 806, 605 N.E.2d 600 (1992).
We note that the defendant in this case should not have used a nunc pro tunc motion to request additional credit for presentence incarceration. The record shows *660 that the trial court's sentencing order was not in conflict with its previous decision concerning this credit. Therefore, we will construe the defendant's nunc pro tunc motion as a motion to amend the mittimus. See Baker v. Department of Corrections, 106 Ill.2d 100, 87 Ill.Dec. 560, 477 N.E.2d 686 (1985).

II.
Next, the State contends that we lack jurisdiction to consider the defendant's appeal because the defendant did not file a postplea motion under Supreme Court Rule 604(d) (Official Reports Advance Sheet No. 4 (February 16, 2005), R. 604(d), eff. February 1, 2005).
Filing a timely Rule 604(d) motion is a condition precedent to appealing from a conviction based on a guilty plea. Generally, a trial court loses jurisdiction over a criminal matter after the 30-day period for filing such postjudgment motions. Subject to exceptions not relevant to the present case, an appellate court lacks authority to consider an appeal from a conviction following a guilty plea if the defendant failed to comply with Rule 604(d). People v. Flowers, 208 Ill.2d 291, 280 Ill.Dec. 653, 802 N.E.2d 1174 (2003). Nonetheless, a trial court retains jurisdiction to consider correcting nonsubstantial matters, such as amendment of the mittimus, after it has otherwise relinquished jurisdiction. Baker, 106 Ill.2d 100, 87 Ill.Dec. 560, 477 N.E.2d 686.
In the instant case, the defendant asked the trial court to amend the mittimus to reflect additional credit for presentence incarceration. Under Baker, the trial court retained jurisdiction to consider this issue after it relinquished jurisdiction to consider a Rule 604(d) motion. Since the defendant is appealing from the trial court's denial of his motion to amend the mittimus, we have jurisdiction to consider this appeal.

III.
On the merits of his motion, defendant argues that the trial court erred by denying his request for additional credit for presentence incarceration. Specifically, he argues that he should have been given credit from March 11, 2003, when he was arrested for violating his MSR because of the criminal conduct that led to the charges in this case.
The statute governing credit for presentence incarceration states that "[t]he offender shall be given credit [against his prison sentence] 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 2002).
It is mandatory under section 5-8-7(b) that a trial court give credit to a defendant for his presentence incarceration. People v. Whitmore, 313 Ill.App.3d 117, 245 Ill.Dec. 910, 728 N.E.2d 1267 (2000). We review the scope and application of a statute de novo. People ex rel. Lumpkin v. Frantz, 306 Ill.App.3d 267, 239 Ill.Dec. 771, 714 N.E.2d 1068 (1999).
The issue presented by the instant defendant appears to be a matter of first impression. As a result, we will look to cases that concern violation of bail bond rather than violation of MSR.
In People v. Hernandez, 345 Ill.App.3d 163, 281 Ill.Dec. 173, 803 N.E.2d 577 (2004), the defendant was arrested for aggravated criminal sexual abuse and posted bond. When the defendant failed to appear in court, the court revoked his bond. He was arrested again for the sex offense charge. While the defendant was in custody the second time, the State simultaneously dismissed the sex offense charge and charged the defendant with the offense *661 of violating his bail bond. Ultimately, he was convicted and sentenced for the bail bond offense. The trial court gave the defendant credit for time served from the time he was charged with violating his bail bond. The appellate court held that the defendant was entitled to credit for time served from the date the defendant was arrested the second time.
The Hernandez court noted that "the State manipulated [the] defendant's liberty when it allowed him to remain in custody for approximately four months without bail before formally charging him with violating his bail bond." Hernandez, 345 Ill.App.3d at 170, 281 Ill.Dec. 173, 803 N.E.2d at 583. The court said that such actions by the State were contrary to the legislature's intent to give a defendant credit for all time served in confinement. Hernandez, 345 Ill.App.3d at 171, 281 Ill.Dec. 173, 803 N.E.2d at 583.
In People v. Roberson, 212 Ill.2d 430, 289 Ill.Dec. 265, 819 N.E.2d 761 (2004), the Illinois Supreme Court cited Hernandez with approval. In Roberson, the defendant was arrested for burglary and posted bond. After he failed to appear in court, he was arrested in another state and extradited to Illinois. Approximately eight months later, the defendant was charged with violating his bail bond. He again posted bond on the burglary charge. Two days later, he was arrested for the bail bond violation. The State proceeded only on the bail bond offense, for which he was convicted and sentenced.
The Roberson court ruled that the defendant was entitled to credit for time served in presentence custody from the date of his second arrest. The court noted that:
"if [the] defendant had been charged with failure to appear contemporaneously with the execution of the second arrest warrant, there is no question that he would have received credit [from the trial court] * * * for the time he served while awaiting trial. Instead, he was not charged until approximately eight months later, prompting the trial court to articulate that he was not `in custody' on the violation of the bail bond charge during that time." Roberson, 212 Ill.2d at 439, 289 Ill.Dec. 265, 819 N.E.2d at 766.
The Roberson court also observed that "once a defendant is arrested for an offense he or she is clearly `in custody' for that offense even before he or she is formally charged." Roberson, 212 Ill.2d at 439, 289 Ill.Dec. 265, 819 N.E.2d at 766.
We find this case to be analogous to Hernandez and Roberson. The defendant committed the offenses in this case in January and February 2003, and he was arrested for violating his MSR because of the conduct that led to the charges for these offenses on March 11, 2003. However, he was not formally charged with these offenses until September 16, 2003. Although it certainly does not appear intentional in this case, the State "manipulated [the] defendant's liberty" by not charging him with these offenses for several months after he was already in DOC custody on the MSR violation. See Hernandez, 345 Ill.App.3d at 171, 281 Ill.Dec. 173, 803 N.E.2d at 583.
Furthermore, even though the defendant was in custody for the MSR violation, the trial court did not consider the defendant to be in custody for the offenses in this case until February 11, 2004, when he was formally served with the arrest warrant at the arraignment. Nonetheless, under the rationale of Hernandez and Roberson, the defendant was "in custody as a result of the offense for which the sentence was imposed" in this case once he was arrested for violating his MSR in the prior cases. 730 ILCS 5/5-8-7(b) (West 2002).
*662 Additionally, both the Illinois Supreme Court and this court have stated that a defendant who is in simultaneous custody on two unrelated charges is entitled to credit for time served with regard to both sets of charges. See generally People v. Robinson, 172 Ill.2d 452, 217 Ill.Dec. 729, 667 N.E.2d 1305 (1996) (defendant entitled to credit for both offenses when in simultaneous presentence custody on two unrelated charges, citing People v. Arnhold, 115 Ill.2d 379, 105 Ill.Dec. 231, 504 N.E.2d 100 (1987)); People v. Chamberlain, 354 Ill.App.3d 1070, 291 Ill.Dec. 39, 822 N.E.2d 914 (2005) (defendant entitled to credit for presentence custody while simultaneously also serving prior sentence). In the instant case, the defendant was in simultaneous custody for violating his MSR in two other cases and for the conduct that led to the State's delayed charges in this case. Under the rationale of Robinson and Chamberlain, the defendant is entitled to credit for presentence custody while in simultaneous custody for multiple offenses. Therefore, we hold as a matter of law that defendant is entitled to credit against his sentence from March 11, 2003, the date he was arrested.

CONCLUSION
The judgment of the Peoria County circuit court is reversed. Under Supreme Court Rule 615(b)(1), we modify the trial court's sentencing order to give the defendant credit for his presentence custody from March 11, 2003, to April 26, 2004. 134 Ill.2d R. 615(b)(1). We also order the DOC to recalculate the defendant's release date consistently with this order. See 134 Ill.2d R. 615(b)(1). Last, because this order may affect the defendant's release date, we also order the mandate to issue immediately. 155 Ill.2d R. 368(a); 177 Ill.2d R. 612(q).
Order denying motion to amend the mittimus reversed; sentencing order modified.
BARRY and SCHMIDT, JJ., concurring.
