Adding hasSaveError function in model