created a proper validation for empty values