Implemented error handling.