Added method to check for WS connection state