Added instantaneous loop detection