somewhat more failsafe makeurl method