Generate only if the list isn't empty