Added popup cancel logic