added dynamic tld and fixed a refactor-bug