fix max number of threads