fixing factory singleton