join url's using separate function