Fix repeatedly sending packets bug