fix several bug

1.add thread join
2.fix uniquequeue bug