Add code to delete the foreach loop