Added logic for deletions on root nodes