Fix: Using wrong iteration in markProcessed