fixed bug with sockets