finishing the iteration