add logic for Error instance