handle empty tree in erase