fixing memory corruption from std::moveing the same object in a loop