You should add this check to the macro. The `while` loop there can only run if this test passes.