introduce retries and connection resetting