handle generate id and no generated id situation