Loop detection updated