added asyncio compatibility