fixed the condition for _isDone