move the response checking up into the retry clause (bug 838885)