fix opening and closing tags