fix `flush` and `flushComplete` events