fix nested factories.