fixing dao to not fall over with empty record index