Integrity check function added.