Final working of popup