add support for reconnects