changed char* to std::string&