infinite loops in AD fixed