fixed bug with checkComplexity method