Now handle disconnection and reconnection properly