adding code for corrupted frame debug message; edit code for SC/DS pair