use foreach
Fix #303: Default Farm Logic disappears with smaller circuits