fix imports
Fix race conditions on flush actions