added reconnect support