changes to address kcooney's concerns about thread safety on issue #742
Merge pull request #765 from adam-beneschan/742

changes to address kcooney's concerns about thread safety on issue #742