Fix url determination