Fix a bug in pick_node fuction

Reduce NCP, but still not good enough.