added escapeString func