add flush_callback