added a callback functionality at the end of an iteration