added option to use sorted catalogs