adding udp to typecast funciton