update download function, and more