update download logic