moved import to the try block for asyncio