Changed to fix paralellization bug.