changed contents[i].token in insert_to_vector to contents.at(i).token
it works