make sure event thread is started before shutting down