fix conditional for self-closing tag