Added debug mode tracing