Fix wrong call of factory.create