update category_id change function.