fix for issue #29, concurrent modification