added check for 0 response code