fixed a small bug in factory method
npmv