new function to resolve relative urls