Fix escaping function