add path and top level domain logic