better encode-fix