change static int -> static std::atomic<int>