updating status check to better handle error responses