fix bitset thread safety, need to do more testing on bitset in the
future