Fix bug in stampede logic