Fixed issue with double encoding