bug-fix: var defined in wrong location