fix encode system