add retries to reconnect