removed 'escape' function, use 'replace' instead