Fix problem with std::future