function node isComplete function fixed