fixed bug in pre-existing node return logic