Fixed wrong local state of a file after a download finishes