fixing highlight logic