Moved websocket logic into a loop