preventing crash when downloading data