decode data coming from websocket