minor fix in retries logic