the break should be outside the if block, shouldn't it?