updating sanitizer to handle when content is null or undefined