update sanitize function