added escapeRegExp