fix output encode issue