fixed deletion of nodes