Final fix for erroneous usage of for each