fix on crc16 and if conditions