Added check for empty strings for email