Fix domain checking bug