# Deferred code that is in a scope that is cancelled by race won't run if the expression after defer is an ongoing race.

**URL:** <https://forums.unrealengine.com/t/deferred-code-that-is-in-a-scope-that-is-cancelled-by-race-wont-run-if-the-expression-after-defer-is-an-ongoing-race/2175652>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, open, fortnite\
**Created:** [December 6, 2024, 5:26am UTC](https://forums.unrealengine.com/t/deferred-code-that-is-in-a-scope-that-is-cancelled-by-race-wont-run-if-the-expression-after-defer-is-an-ongoing-race/2175652 "2024-12-06T05:26:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enebz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/enebz/32/875411_2.png) [@Enebz](https://forums.unrealengine.com/u/Enebz)\
**Post date:** [December 6, 2024, 5:26am UTC](https://forums.unrealengine.com/t/deferred-code-that-is-in-a-scope-that-is-cancelled-by-race-wont-run-if-the-expression-after-defer-is-an-ongoing-race/2175652/1 "2024-12-06T05:26:33Z")

</div>

### Summary

Deferred code that is in a scope that is cancelled by race won’t run if the expression after defer is an ongoing race.

### Please select what you are reporting on:

Verse

### What Type of Bug are you experiencing?

Verse

### Steps to Reproduce

1. Create a new verse device and paste this code in the OnBegin function

```auto
race:
    block:
        defer:
            Print("Deferred print")
        race:
            Sleep(Inf)
            Sleep(Inf)
    block:
        Sleep(3.0)

```

### Expected Result

“Deferred print” should show in the output log when the race finishes.

### Observed Result

“Deferred print” does not show in the output log when the race finishes.

### Platform(s)

Windows 11

### Island Code

2834-1467-3997

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/1223650_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [July 21, 2026, 8:00pm UTC](https://forums.unrealengine.com/t/deferred-code-that-is-in-a-scope-that-is-cancelled-by-race-wont-run-if-the-expression-after-defer-is-an-ongoing-race/2175652/3 "2026-07-21T20:00:49Z")

</div>

FORT-832626 has been ‘Backlogged’. This is an issue that is in a queue to be addressed.
