Move retry count increment so that max_retries actually means retries and not attempts.