modified the last lines in the file