Added loop-prevention (replaces explicit setting)