fix bug in trace output