add ordering check