fixed old convesion from std::string to c_string
avoiding null pointer exception