fix exception when tokens === null