fix encode type