finish download functionality