route change and some websocket functions