Fixing url joining function