
991 P.2d 291 (1999)
The PEOPLE of the State of Colorado, Plaintiff-Appellee,
v.
Jeffrey William WIDHALM, Defendant-Appellant.
No. 97CA1077.
Colorado Court of Appeals, Div. III.
February 18, 1999.
Rehearing Denied March 18, 1999.
Certiorari Denied October 18, 1999.[*]
*292 Gale A. Norton, Attorney General, Martha Phillips Allbright, Chief Deputy Attorney General, Richard A. Westfall, Solicitor General, Roger G. Billotte, Assistant Attorney General, Denver, Colorado, for Plaintiff-Appellee.
David F. Vela, Colorado State Public Defender, Joan E. Mounteer, Deputy State Public Defender, Denver, Colorado, for Defendant-Appellant.
Opinion by Judge ROY.
Defendant, Jeffrey William Widhalm, appeals the judgment of conviction entered upon jury verdicts finding him guilty of first degree burglary, reckless endangerment, violation of a restraining order, and two counts of prohibited use of a weapon. He also appeals the revocation of his probation. We affirm in part and reverse in part.
On August 26, 1996, defendant entered the apartment of his estranged wife (victim) in violation of a county court restraining order prohibiting him from coming within 100 feet of the victim or her residence. While in the apartment, defendant threatened suicide, produced a handgun, entered a bathroom and closed the door, and discharged the weapon. Upon hearing the gunshot, the victim took their two-year-old daughter out of the apartment and elicited the assistance of her neighbors. Shortly thereafter, defendant exited the bathroom and went onto the apartment balcony, placed the handgun against his temple, and in the presence of the victim made numerous threats to kill himself.
The trial court imposed concurrent sentences of four years probation for first degree burglary, six months in county jail for each prohibited use of a weapon count, six months in county jail for reckless endangerment, and one year in the county jail for violation of a restraining order. The trial court also ordered defendant to complete two years of work release as a condition of his probation.
Defendant thereafter initiated this appeal and, subsequently, violated the terms of his probation. Consequently, while this appeal was pending and without a limited remand, the trial court removed defendant from the work release program, revoked his probation, and sentenced him to four years in community *293 corrections for first degree burglary. The remaining sentences were left intact and concurrent.

I.
We first address, and reject, defendant's contention that the trial court lacked jurisdiction to revoke his probation following the filing of a notice of appeal.
A court must always have jurisdiction to act. Thus, any action taken by a court when it lacks jurisdiction is a nullity. McLeod v. Provident Mutual Life Insurance Co., 186 Colo. 234, 526 P.2d 1318 (1974).
As a general rule, when an appeal has been perfected, the trial court is divested of jurisdiction to issue any further orders in the case. Brooke v. People, 139 Colo. 388, 339 P.2d 993 (1959). However, there are recognized exceptions to this general rule. One such exception is that a trial court retains jurisdiction over proceedings that are either authorized by statute or rule or do not involve a challenge to the propriety of the judgment on appeal. See, e.g., In re Marriage of McCue, 645 P.2d 854 (Colo.App.1982) (recognizing that the trial court is not precluded from enforcing its judgment, even though an appeal is pending); see also Johnson v. District Court, 674 P.2d 952 (Colo. 1984) (recognizing that policy considerations and analytical framework in civil context are sometimes persuasive and instructive in criminal context).
In People v. Taylor, 876 P.2d 130 (Colo. App.1994), a division of this court held that because there was an automatic stay of probation under a prior codification of C.A.R. 8.1(a)(4) upon the filing of a notice of appeal, the trial court was deprived of jurisdiction to revoke a probation.
Since Taylor, however, C.A.R. 8.1(a)(4) has been amended so as to remove the automatic stay. The rule presently provides that:
An order placing the defendant on probation shall remain in effect pending review by an appellate court unless the court grants a stay of probation. (emphasis added) Similarly, § 16-11-202(1), C.R.S.1998, provides:
If the court chooses to grant the defendant probation, the order placing the defendant on probation shall take effect upon entry and, if any appeal is brought, shall remain in effect pending review by an appellate court unless the court grants a stay of probation pursuant to section 16-4-201. (emphasis added)
Here, it is undisputed that defendant did not request a stay of execution pending the resolution of his appeal.
In our view, absent a stay of the probation, the trial court retains jurisdiction to modify and terminate probation. The proceedings to revoke, and the procedure for revoking, probation are authorized and provided for by statute. Section 16-11-205, C.R.S.1998. To deny the trial court jurisdiction to enforce its orders without a limited remand would, in effect, either suspend the statutes and the rules associated with probation or unduly complicate their enforcement. This is particularly true when, as here, the sentence has not been appealed.
In the absence of a stay of execution, a court order revoking probation merely enforces the court's prior order of probation in accordance with proceedings authorized by statute and does not involve the underlying conviction which is on appeal. Thus, we hold that the trial court continued to retain jurisdiction to enforce its probation order in the same manner as if no appeal had been filed.

II.

A.
Defendant next contends that his conviction of first degree burglary must be reversed because the predicate crime, a violation of a restraining order, is not a crime. We do not agree.
At the close of trial, the trial court instructed the jury that, in order to convict defendant of the crime of first degree burglary, the prosecution had to prove beyond a reasonable doubt that defendant "knowingly, entered and remained unlawfully in a building *294 or occupied structure, with intent to commit therein the crime of Violation of Restraining Order...." The trial court further instructed the jury that a person violates a restraining order when he or she "contacted a protected person or persons, intimidated a protected person or persons, or entered protected premises" in violation of a court order. The jury returned a verdict finding defendant guilty of first degree burglary with the predicate crime of violating a restraining order.
In People v. Rhorer, 967 P.2d 147 (Colo. 1998), our supreme court held that a violation of a restraining order constitutes a crime under §§ 18-6-803.5(1) and 18-6-803.5(2), C.R.S.1998, and thus could be a predicate crime for second degree burglary. Based on Rhorer, we conclude that the jury was appropriately instructed that a violation of a restraining order could serve as a predicate crime for first degree burglary.

B.
Defendant next maintains that because he violated the restraining order when, prior to entering, he came within a 100-yard radius of victim's apartment, he could not be guilty of committing first degree burglary which requires the intent to commit the crime upon entry. At most, he argues, he was guilty of trespass and the trial court erred in denying his motion for an acquittal because, under § 18-4-202(1), C.R.S.1998, the predicate crime for first degree burglary must be a crime other than trespass. We disagree with this argument.
When reviewing a ruling on a motion for judgment of acquittal, our task is to determine whether the relevant evidence, both direct and circumstantial, when viewed as a whole and in the light most favorable to the prosecution, is substantial and sufficient to support a conclusion by a reasonable person that a defendant is guilty of the charge beyond a reasonable doubt. People v. Bennett, 183 Colo. 125, 515 P.2d 466 (1973). The prosecution is given the benefit of every reasonable inference that might fairly be drawn from the evidence as long as there is a logical and convincing connection between the facts established and the conclusion inferred. People v. Gonzales, 666 P.2d 123 (Colo.1983). Furthermore, it will be assumed that the jury adopted that evidence, or any reasonable inferences therefrom, which supports its verdict. Wilson v. People, 143 Colo. 544, 354 P.2d 588 (1960).
The evidence indicates that in addition to prohibiting defendant from coming within 100 yards of the victim's apartment, the restraining order also ordered defendant not to have any direct contact with the victim. Therefore, we conclude that the evidence supports a finding beyond a reasonable doubt that defendant entered the victim's apartment with an intent to contact her directly and thus to violate the restraining order. The evidence further indicates that upon entering the victim's apartment, defendant contacted the victim, telling her that she was going to watch him commit suicide. Thus, the evidence suggests that defendant not only violated the restraining order when he entered the 100-yard radius of the victim's apartment, but also violated it by making contact with the victim, and had the intent to do the latter when he entered the apartment.
We therefore hold that the trial court did not err in denying defendant's motion for acquittal.

III.
Defendant lastly contends that he is entitled to an additional 61 days presentence confinement credit for the time spent in work release as a condition of probation. We agree.
On May 5, 1997, defendant was sentenced to four years probation for first degree burglary conditioned on his serving two years in the Jefferson County Jail on work release to be served concurrently with sentences of lesser duration to the county jail for the other offenses. On October 28, 1997, following the probation revocation, defendant was sentenced to four years in community corrections again concurrent with the county jail sentences for the other offenses. At the resentencing, defendant was given presentence confinement credit for 66 of the 127 *295 days he had been in the work release program.
Section 16-11-306, C.R.S.1998, which governs presentence confinement credit, provides in pertinent part:
A person who is confined for an offense prior to the imposition of sentence for said offense is entitled to credit against the term of his sentence for the entire period of such confinement. At the time of sentencing, the court shall make a finding of the amount of presentence confinement to which the offender is entitled and shall include such finding in the mittimus....
This section requires a sentencing court to credit a defendant with that period spent in custody as the result of the charge for which the sentence is imposed or as a result of the conduct on which such charge is based. Schubert v. People, 698 P.2d 788 (Colo.1985). There must be a substantial nexus between such charge or conduct and the period of confinement for which credit is sought. See Schubert v. People, supra.
In People v. Lee, 678 P.2d 1030 (Colo.App. 1983), a division of this court determined that a defendant is entitled to the time of his actual confinement in a county jail while participating in a work release program, but not for the time spent away from the facility at work.
Defendant asserts that our supreme court implicitly overruled Lee in People v. Hoecher, 822 P.2d 8 (Colo.1991), which, he asserts, mandates that the trial court credit defendant for the full time he participated in the work release program. The rationale of Hoecher leads us to agree with this assertion.
In Hoecher, the defendant was sentenced to community corrections and initially served the sentence in a residential status and then was placed in a nonresidential status. When the defendant's sentence to community corrections was revoked, he was sentenced to the Department of Corrections with presentence confinement credit for the time he served in a residential status but with no credit for time served in a nonresidential status. A division of this court reversed and the supreme court reversed the division, affirming the trial court's sentence.
While the facts as recited by the supreme court do not indicate whether the defendant in Hoecher was employed outside the facility during the residential portion of his sentence, the court's description of the community corrections program derived from the statutes authorizing it indicates that such employment is certainly contemplated. With respect to credit for time served in the residential portion of a community corrections program, the court stated:
An offender sentenced to a community correctional facility is confined in a very real sense during the period of time in which the offender remains on residential status. Even if released for work or other rehabilitation activity, such offender would be substantially restricted in his freedom of movement and range of activity and would be duty-bound to return to the community correctional facility each day upon completion of the limited-release program.... A court about to resentence such offender for violating the conditions of the community correctional placement, therefore, should credit the offender for the time served as a resident of a community correctional facility.
Hoecher, supra, 822 P.2d at 12. (citation omitted)
The basis for the supreme court's analysis in Hoecher was its comparison between residential community corrections and presentence confinement in the county jail. Indeed, the supreme court's analysis commences with a discussion of § 16-11-306, C.R.S.1998, which governs presentence confinement credit for time served in jail, recognizing there is no counterpart in the community corrections statutes. The court concluded that the regimen associated with residential community corrections, even with outside employment, is a form of confinement deserving of presentence confinement credit.
The supreme court did not cite People v. Lee, supra, even though Lee dealt with presentence confinement credit under circumstances where the defendant was on work release while confined to the county jail. The court did cite Lee in Beecroft v. People, 874 P.2d 1041 (Colo.1994), but only for the proposition that presentence confinement *296 credit is available only for time served in jail or in the Department of Corrections, without noting the effect of work release.
We are persuaded that the rationale of Hoecher is equally applicable to a sentence to the county jail with work release as it is to residential community corrections. In each instance, the liberty of a defendant is restricted to a degree substantially greater than that of a person on probation and that restriction on liberty is sufficient to entitle a defendant to presentence confinement credit in both instances. Thus, we conclude that defendant is entitled to an additional 61 days presentence confinement credit.
The judgment is affirmed. The order revoking probation is affirmed except as to the granting of presentence confinement credit with respect to which it is reversed, and the cause remanded for an amendment of the mittimus in accordance with the views expressed in this opinion.
Judge JONES and Judge MARQUEZ concur.
NOTES
[*]  Justice Scott would grant the cross-petition as to the following issue:

Whether the court of appeals erred in concluding that the respondent was entitled to an additional 61 days presentence confinement credit for the time he spent on work release as a condition of probation.
