added better node id check