Added failsafes to sockets, as callback argument