add support for reconnection