ensure the list is non-empty