add saving file and resume