update EachWithBreak function signature