Added Method addErrorMessage