loop detector

loop detector