std::thread issue solved