thread safety statics work …

 changed static to static const where possible otherwise used std::atomic<> when value is changed once