handle empty string with require attribute