modified pattern to work with domains