Fix ConcurrentModificationException while drawing cursor