Changed priority of token validity checking