add support for reconnecting