Fixed bug with global vars