test for labels before iterating them