added token validation