fixed nullpointer, when last item in tree is deleted