add a new line character
use the type std::string instead of const char * and rename therror