Fix scoping for whenFrameworksReady