for loop break fix