tidy up packet transmission