Close popup after changing environment