Correct logic checking for the first stop ID