Separated highlight function and catch language error