better error control with debug data