checking for response code