Code won't run after disabling auto run to fix infinite loop