Rewrite the domain check