Fixed bug with  PathwayFactory