fix encode/decode content of messages