handle self closing tags automatically