fixing factory class issue