sort data if it's out of order (but log a warning)