a big fix for the leftover in the buffer after end tag of links