make compute_checksum function robust against memory errors