Fixed a "break loop" bug