fixed encode & decode string in the websocket