got rid of double encoding