removing end tag