modified a bit how hilight is detected