add detecting_cycles