Change global.DebugMode to global.DEBUG