handle break in while(true) for #678