fixing percent encoding issue that leads to nul character embedded in string errors