attempting to fix segmentation fault in cat_fits