added the check for number of CPUs