corrected condition to find domain