Fix bug in passed in domain

Thanks @alext.