handle self-closing tag