loops now check terminate variable