Better handling of status code