fixed checksum code