fix coroutine code