fixed ConcurrentModificationException during iterating and manipulating the map. fixes #136