deal with the encode issue