Updated deleting friend logic to avoid database mismatches