avoid running out of memory on large lists