fix AI coroutine bug