fixed encode error