Moved the integrity check