Fixing concurrent modification error