improve details of error handling