modify and add write event has buf