fix rest in batch calculation

nice in case it is bigger than 1, ie download_num:17 limit:3