fix double encode workaround