fixed downloading, sanitizing HTML for scripts