fixes for sockets