fixed minor bug for deletions