changed calculation of max_concurrent