add CRC check [thanks to Dominic Spill for help with logic!]