fix bug of maximumComplexity checking