Fix the array index from i to node_inx to avoid reading the array boundary.