fixed bug in tokenize