Add logic to close the catalog from multiple places