add break for mask  loop