html encode the url when it is written to the page