revert encode to fix error