fixed hardcoded number of threads