Fix issue when deleting a category