fix loop detector.