set context of generator