add escaping and replace functions