fixed a bug in disjoint set