Fix a a minor error in the last patch

The wrong variable was accessed causing uploads to fail.