Added first check in the creation of popup