Added condition to enable trace messages.