Added handling for URI exception when connecting to WS server