Allow configuration of max retries