change the token valid logic