getting websockets loop working