added better support for tracing.