Added code to gracefully refuse deletion of a category that is in use by an item