fix for sanitize function