Fixed factory problem