fixing php factory class issue