Make number of retries a config option