fix for crash on multiple sockets