convert map to serializable item to keep the map keys order when encoding and put the serializable item back to map after decoding