fix bug when adding appointment without aWaitingId