added missing boolean that was causing loop to fail