category update logic