update error handling.