added closing tags support