Improve downloading files

Fix incomplete download

Add downloading listener