limit the number of retries