fixing an edge case when an isolated context has a function