only attempt to stop EM loop when running