Added debug mode for console