Modified baseurl logic