fix double encoding