implementing error control