Since file was updated in the loop, this value usually referenced the last file in the array, instead of the file when we created the closure.