Fix encode issue