break out of case correctly at end