sug-181 fixed stack overflow while token validation