Revised the error handling section