Removed switch case of string as it is not supported on JDK under 1.7
Initialize retry once for every request.