fixing crc calculation