fix url parsing when url passed in a string