better debug logging