Fix the CheckIfCompleted method

It caused a StackOverflow before.