fixes coroutine implementation