fix error by encoding