Fix dead coroutine (scoping problem)