Changed websocket code