Handle loss of connection