Well, you can move the checking to be after/below the wait(1) statement.
Then use another variable to keep the c_trace result instead of using trace_hit