fix encode issue.