guard some tracing with if (debug)