added string escaping function