make sure flushServiceQueue() before closing