Fixed error for globals defined outside of function/method