Correct global/local variable error in resources manager