Add is.error method is used to detect whether the element error