added async error handling