added threadsafe attribute