finish udp logic