retrieves and set context