Sup, anyone mind taking a look at this?

The important part is the if(searchCount == itsCount) statement. itsCount is a static int that counts how many instances of the class there are. So basicly with that if statement it will terminate the search since that would mean its searched all instances if itsCount == searchCount.

If I enter 5 instances of the class, itsCount = 5, so therefor searchCount should not return *this until its = 5, which it should eventually get to. Where ++searchCount is located it makes sense that after it reaches 5 on the next search node.. it should equal itsCount, and terminate, however what it does freeze after the cout says they are indeed both 5, it freezes. If I move it up to where "it works" it wont freeze and works fine, but will count -1 the actual value, which makes sense why it shouldnt be before that if statement.

Code:
Node& Node::Search(USHORT level, string name) {
  static ULONG levelCount = 0;
  static ULONG nameCount = 0;
  static ULONG searchCount = 0;

  USHORT thisLevel = itsPlayer->GetLevel();
  string thisName = itsPlayer->GetName();

  if((thisName == name) && (thisLevel == level)) {
    cout << "Success, match found!" << endl;
    return *this;
  }

// ++searchCount; works here

  if(searchCount == itsCount) {
    cout << nameCount << " name matches found." << endl;
    cout << levelCount << " level matches found." << endl;
    return *this;
  } else {

// having it here doesnt work
    ++searchCount; 
    cout << "test: \t" << searchCount << "\t" << itsCount << endl;       
  }

// or having it here

  if((thisName != name) && (thisLevel != level)) {
    itsNext->Search(level, name);
  } else if((thisName != name) && (thisLevel == level)) {
    ++levelCount;
    itsNext->Search(level, name);
  } else if((thisName == name) && (thisLevel != level)) {
    ++nameCount;
    itsNext->Search(level, name);
  } else {
    cout << "Cannot determine arguments for: Node& Node::Search(int level, string name)" << endl;
  }

  return *this;
}
Any ideas? I tried some things but had no luck.. seems like an odd crash, I must be missing something about how to use static's or something.

Thanks in advance!