fix token slicing bug