update error handling