save a copy of context in curl handler