major bugfixes to url detection