Remove foreach variable shadowing merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>