handled flusing at the output level