try with just tokenIndex not charIndex etc...