define err check