changed erroneous .split iterator on foo in bar to .each