Added trace_file logic