BugFix: add main function scope as var to all "subfunctions"
Merge branch 'DataLoadingUI'