some changes for packet sending