Minor change to add logic to replace whitespace with % escape characters