Function sanitizeName