mistake involves freeing url. not sure how to fix without leaking