fix bug when downloading