fixed a bug while deleting files after a process is done and started programming download logic