Handle the case where the user exits the panel