Fixed issue #5 and websocket implementation in general