fix possible concurrent modification exceptions