Cap number of retries and make it an option