Change flush to finalize