fixed removing items in for loop