moved scoping var issue