fix bug in url determination