Added global keyword to global variable