Add max retries option