fixed broken var and added debugMode