fix node deallocation