cancel error function