fixed a bug caused by change to getCurrentFactory