@Override
	protected void handleMessage(Object o) throws Throwable {
		if(state != null && state.isDisconnected()) {
			agentPrintMessage("Peer disconnected, ignoring message "+o.getClass().getCanonicalName());
			return;
		}

		try {
			if(o instanceof UncheckedMnTreeMessage) {
				handleUncheckedMnTreeMessage(o);
			} else if(o instanceof MnTreeMessage) {
				if(state == null) {
					waitingState.addLast((MnTreeMessage) o);
					return;
				}
				
				MnTreeMessage mnm = (MnTreeMessage) o;
				MnId dest = mnm.getRecipientMn();
				if(dest == null)
					throw new Error("Destination MN id not set for message "+mnm.getClass().getName());

				if(! dest.equals(state.getThisMnId())) {
					agentPrintMessage("Wrongly routed message: "+
							o.getClass().getSimpleName());
					if(! (mnm instanceof WrongRouteMessage)) {
						com.sendDatagramMessage(new WrongRouteMessage(mnm.getSender(), state.getThisMnId(),
								mnm.getSenderMn(), mnm));
					}
					return;
				}
				handleCheckedMnTreeMessage(o);
			} else {
				handleEvent(o);
			}
		} catch (Throwable e) {
			agentPrintMessage("Following error occured during message handling:");
			agentPrintMessage(e);
			agentPrintMessage("Propagating error...");
			propagateError(e);
		}
	}