Fixed send_udp_packet function