global variable fixing