synchronized public void updateMessages() {
        while (bornlist.size() > 0)
            list.add(bornlist.pop());
        while (list.size() > 0 && list.peek().state == DeliverState.delivered) {
            list.pop();
            messageCount--;
        }
    }