adds initial handling of sockets