Updated Sanitize Function