Don't use pop_back on string, use erase instead