do not flush if em is closed (when an exception has been thrown for example