fixing some sockets
fixing sockets
adding debugging hooks