adding error detection

added error frame detection with the assumption that if the counter in
bit field 9-12 is out of sequence, then there was a missed frame.