trace cleanup