add eventHandler for sockets