add on_write_finished event