added better error checking for the checksum process