main: flush data after packet