fixed del_node to be more efficient