smarter debug setting