fixed token sort detection