Put throw outside while block.