WebSocket bug fix + threaded handling