Add a function to detect if we have async or not