Fix the get node id logic