fixing the scope of the std::vectors