fix encode category