fixing the highlighting on pan