fix the endhighlight bug