adding mechanism to check for existing products referencing categories before deleting categories.