fix the problem to make the number of stops can work