fix checksum calculation