fix a major bug which arises when caching factor ids and using multiple processes