fix bad url handling