Fixes race condition with page.context