cleanup switchToResourcesParentIfRequired hack