use NSLock for exclusive control instead of Dispatch::Queue.main.sync