fixed segfault (list item erased without breaking iteration over list)