add isConnected() method