added error handling statement