Added an error handling section