move break into if