token variable undefined