fixed the way the loop breaks if isAdditive becomes false