change closure each to normal loop