fix exit code when there are retries