change publish and subscribe to use new sockets functionality