Use node value from iteration rather than the first tuple

Signed-off-by: Gowrishankar Rajaiyan <gsr@redhat.com>