add checksum and fix some errors