improve debug logging