created sanitizeString function