fix method that returns token type.