Fix/global context

/cc @mishanga