check if there are items, before walking through the list