why is this test inside the loop?