Fixed problem when resuming download the 2nd time