add switch window update hook