improve highlight function