made InMemoryKeyValueStore atomic