passing the correct attributes property to the factory