fix async error handling