private void handleBidSubmission(TACMessage msg) {
    Bid bid = (Bid) msg.getUserData();
    int status = NO_ERROR;

    while (msg.nextTag()) {
      if (msg.isTag("bidID")) {
	int id = msg.getValueAsInt(Bid.NO_ID);
	bid.setID(id);
      } else if (msg.isTag("bidHash")) {
	String hash = msg.getValue();
	bid.setBidHash(hash);
      } else if (msg.isTag("rejectReason")) {
	int reject = msg.getValueAsInt(Bid.NOT_REJECTED);
	bid.setRejectReason(reject);
	if (reject != Bid.NOT_REJECTED) {
	  bid.setProcessingState(Bid.REJECTED);
	}
      } else if (msg.isTag("commandStatus")) {
	status = mapCommandStatus(msg.getValueAsInt(NO_ERROR));
      }
    }

    if (bid.isRejected()) {
      // reset the active bid!
      revertBid(bid, NO_ERROR);
    } else if (status == AUCTION_CLOSED) {
      // reset the active bid!
      revertBid(bid, status);
      // Let the quote close the auction later!
    } else if (status != NO_ERROR) {
      fatalError("Can not handle bid submission: "
		 + commandStatusToString(status), 5000);
    } else {
      // Request Bid info
      TACMessage msg2 = new TACMessage("bidInfo");
      msg2.setParameter("bidID", bid.getID());
      msg2.setUserData(bid);
      sendMessage(msg2, this);

      // Should not do this until bidinfo arrives where the bid is
      // hopefully no longer preliminary. (For backward compability!)
//       agent.bidUpdated(bid);
    }
  }