clone the list to avoid potential concurrent modifications