Fixing bug where global path is overwritten by local scope.