added timeout to websocket connect