made globals in defined functions work
Caught another type of bad gui config