close file after it is done transferring