fix initial url detection