minor fix in sorting nodes