changed the trace context saving to execute it in background