A better cart validity check