Handling malformed urls