enhance sanitize function