replaced string::data() with string::c_str()