added fix for malformed urls