fix list bug in factory pattern