correct checksum and bom logic loop