close the file when process finish