fixed MQTT serialize/deserialize