make sure sequences are not out of order