fixed the bug of selecting nodes