fix for performance issue concerning text hilighting