added reconnect mechanism on broken remote connections.