added master, fixed sockets