Fixed issue.

Fixed issue, when only the last break in the loop actually worked.