added isComplete function