Added debug mode setting