Fixed bug when downloading large files