Fixed bug due to ConcurrentModificationException