fixed the issue that ordering error when nothing is removed in popup