fix two bugs

about no closing tag
about having attributes tag