fixed incorrect assignment of node labels