Copy list before iteration, avoid concurrent modification

closes #61
Merge pull request #62 from vishna/issue_61

Copy list before iteration, avoid concurrent modification