make debugmode a static variable, false by default