add flushIfEmpty param to bufferWithTime