Move var in fix for #6410
Merge pull request #258 from jashua212/bug_6410

Move var in fix for #6410