Fixing issue with validating error message