Moved the response status code check