Fixed problem with size of packets and added error check in read_thread_udp