fix coroutine swap bug