handle malformed urls