check for NaN in tokenization functions