fixed logic errors in category pages