changed how get_max_threads works