Fix isNameMatched function error