added logging to check_integrity