added check for html and body tag for paragraphs