Add an error handling.