Modified code and article with custom error message