changed logic for category view page