adding helper function to parse websocket stuff