repl: handle disconnction