changed loop breaks