better error handling for the user