Thread safety

yes, I actually have a couple of other things I spotted. I will do with this one and others.