added fallback for number of cores