Corrected NameError for invalid variable
Merge pull request #5136 from mitocw/cg/bugfix/namerror_legacy

Corrected NameError for invalid variable