Finish the foreach loop