Made the callback for download() scoped.