added tracing
trace is optional