fixed encode problem