popup logic changed