fixed bug setting state in download