public MyRemote lookup(String serviceName) throws RemoteException {
		// if the stub exists locally, return the local stub
		if (stubtbl.containsKey(serviceName)) {
			return stubtbl.get(serviceName);
		}
		MyRemote stub = null;
		// send a lookup message to the registry server
		RMIMessage msg = new RMIMessage("lookup", serviceName, rHost, rPort);
		RMIMessage ret = (RMIMessage) commModule.send(msg);

		if (ret != null) {
			// get the ror back from registry server
			RemoteObjectRef ror = (RemoteObjectRef) ret.getContent();
			if (ror == null) {
				throw new RemoteException("Lookup Fail");
			} else {
				// instantiate a local stub
				stub = (MyRemote) ror.localise(commModule);
				stubtbl.put(serviceName, stub);
			}
		}
		return stub;
	}