replaced multicast socket with for each loop