fixed issues with sockets