removed optional removal of closing tag (was causing too many problems)