close tags correctly in htmlg