Minor fix for the logic when doc add is called with no id.