implemented retries with -r