Fixed the variable for counting number of retries