fix encode problem