fix ordering bug for nodes