fixed encode_properties