fixed some bugs for cat testing