Fix the issue for fragment switching and fragment gathering