fix encode issue