Fix concurrent modification error