fixed bug in deleteNode