threadsafe bug
merged branches