Copy context to avoid secondary effects of scoping affecting the thread