add possibility to write to trace file