removes extra closing tag