why check the threshold twice? why not just call `flushMeta(false)` every time?