added some foolproofing to the lossless udp protocol