Add isRetry flag to prevent infinite retry.