add data integrity check