letting debug setting be optional