Fixed threading issue with ThreadSafeSet