fixed the factory