Fix AttributeError: object has not attribute ulr.