Added nodeRemoved logic