fix tracking for switching windows