Update to integrate code for WebSocket, still debugging