save tmp result at each iteration