Added configuration parameter to control retries