added gaurd against invalid catalogs