fix matrix highlight so that it works with multiple matrices on same page