Use WebSocket ready state instead of this.connected