slight fix to make global vars work