fixed bug where Download Thread does not end