fix url parsing when url passed in as string