made game threadsafe