added timeout parameter in WebSocket