if err is nil then return location url