fix for exports and variable scope.