Add reconnection feature to websocket