added function that saves the file and kills the file