fix some display issues
don't die when writing a message after the websocket has closed