implemented error detection of frames