add manual error control function