adapted code so that websocket controller is used with shared pointers