fixed invalid read after deleting a node