made eventmanager threadsafe