compatible with make_local_context