Fix highlighting logic