added response.status check