fixed issues with switching popups switching