working on sockets wrapper