modify tokenize method